home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / DTS Sample Code / Macintosh Sample Code / Monthly Releases (Compressed) / MacDTS.Sample.Code.88.11.sit / 001. Sample / Sample.a < prev    next >
MacBinary  |  1988-11-02  |  38.4 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert System V 64-bit library (executable/systemV64BitLibrary) ext Unsupported
1% dexvert COFF Library (other/coffLibrary) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Tue Nov 1 20:00:23 1988, modified Tue Nov 1 20:00:23 1988, creator 'MPS ', type ASCII, 38568 bytes "Sample.a" , at 0x9728 408 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 53 61 6d 70 6c 65 | 2e 61 00 00 00 00 00 00 |..Sample|.a......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 96 a8 00 | 00 01 98 9f 94 0e a7 9f |........|........|
|00000060| 94 0e a7 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 93 e7 00 00 |........|........|
|00000080| 2a 0d 2a 09 41 70 70 6c | 65 20 4d 61 63 69 6e 74 |*.*.Appl|e Macint|
|00000090| 6f 73 68 20 44 65 76 65 | 6c 6f 70 65 72 20 54 65 |osh Deve|loper Te|
|000000a0| 63 68 6e 69 63 61 6c 20 | 53 75 70 70 6f 72 74 0d |chnical |Support.|
|000000b0| 2a 0d 2a 09 4d 75 6c 74 | 69 46 69 6e 64 65 72 2d |*.*.Mult|iFinder-|
|000000c0| 41 77 61 72 65 20 53 69 | 6d 70 6c 65 20 53 61 6d |Aware Si|mple Sam|
|000000d0| 70 6c 65 20 41 70 70 6c | 69 63 61 74 69 6f 6e 0d |ple Appl|ication.|
|000000e0| 2a 0d 2a 09 53 61 6d 70 | 6c 65 0d 2a 0d 2a 09 53 |*.*.Samp|le.*.*.S|
|000000f0| 61 6d 70 6c 65 2e 61 09 | 2d 09 41 73 73 65 6d 62 |ample.a.|-.Assemb|
|00000100| 6c 65 72 20 53 6f 75 72 | 63 65 0d 2a 0d 2a 09 43 |ler Sour|ce.*.*.C|
|00000110| 6f 70 79 72 69 67 68 74 | 20 a9 20 31 39 38 38 20 |opyright| . 1988 |
|00000120| 41 70 70 6c 65 20 43 6f | 6d 70 75 74 65 72 2c 20 |Apple Co|mputer, |
|00000130| 49 6e 63 2e 0d 2a 09 41 | 6c 6c 20 72 69 67 68 74 |Inc..*.A|ll right|
|00000140| 73 20 72 65 73 65 72 76 | 65 64 2e 0d 2a 0d 2a 09 |s reserv|ed..*.*.|
|00000150| 56 65 72 73 69 6f 6e 73 | 3a 09 31 2e 30 09 09 09 |Versions|:.1.0...|
|00000160| 30 38 2f 38 38 0d 2a 09 | 09 09 31 2e 30 31 09 09 |08/88.*.|..1.01..|
|00000170| 09 31 31 2f 38 38 0d 2a | 0d 2a 09 43 6f 6d 70 6f |.11/88.*|.*.Compo|
|00000180| 6e 65 6e 74 73 3a 09 53 | 61 6d 70 6c 65 2e 70 09 |nents:.S|ample.p.|
|00000190| 09 4e 6f 76 65 6d 62 65 | 72 20 31 2c 20 31 39 38 |.Novembe|r 1, 198|
|000001a0| 38 0d 2a 09 09 09 53 61 | 6d 70 6c 65 2e 63 09 09 |8.*...Sa|mple.c..|
|000001b0| 4e 6f 76 65 6d 62 65 72 | 20 31 2c 20 31 39 38 38 |November| 1, 1988|
|000001c0| 0d 2a 09 09 09 53 61 6d | 70 6c 65 2e 61 09 09 4e |.*...Sam|ple.a..N|
|000001d0| 6f 76 65 6d 62 65 72 20 | 31 2c 20 31 39 38 38 0d |ovember |1, 1988.|
|000001e0| 2a 09 09 09 53 61 6d 70 | 6c 65 2e 69 6e 63 31 2e |*...Samp|le.inc1.|
|000001f0| 61 09 09 4e 6f 76 65 6d | 62 65 72 20 31 2c 20 31 |a..Novem|ber 1, 1|
|00000200| 39 38 38 0d 2a 09 09 09 | 53 61 6d 70 6c 65 4d 69 |988.*...|SampleMi|
|00000210| 73 63 2e 61 09 09 4e 6f | 76 65 6d 62 65 72 20 31 |sc.a..No|vember 1|
|00000220| 2c 20 31 39 38 38 0d 2a | 09 09 09 53 61 6d 70 6c |, 1988.*|...Sampl|
|00000230| 65 2e 72 09 09 4e 6f 76 | 65 6d 62 65 72 20 31 2c |e.r..Nov|ember 1,|
|00000240| 20 31 39 38 38 0d 2a 09 | 09 09 53 61 6d 70 6c 65 | 1988.*.|..Sample|
|00000250| 2e 68 09 09 4e 6f 76 65 | 6d 62 65 72 20 31 2c 20 |.h..Nove|mber 1, |
|00000260| 31 39 38 38 0d 2a 09 09 | 09 50 53 61 6d 70 6c 65 |1988.*..|.PSample|
|00000270| 2e 6d 61 6b 65 09 09 4e | 6f 76 65 6d 62 65 72 20 |.make..N|ovember |
|00000280| 31 2c 20 31 39 38 38 0d | 2a 09 09 09 43 53 61 6d |1, 1988.|*...CSam|
|00000290| 70 6c 65 2e 6d 61 6b 65 | 09 09 4e 6f 76 65 6d 62 |ple.make|..Novemb|
|000002a0| 65 72 20 31 2c 20 31 39 | 38 38 0d 2a 09 09 09 41 |er 1, 19|88.*...A|
|000002b0| 53 61 6d 70 6c 65 2e 6d | 61 6b 65 09 09 4e 6f 76 |Sample.m|ake..Nov|
|000002c0| 65 6d 62 65 72 20 31 2c | 20 31 39 38 38 0d 2a 0d |ember 1,| 1988.*.|
|000002d0| 2a 09 53 61 6d 70 6c 65 | 20 69 73 20 61 6e 20 65 |*.Sample| is an e|
|000002e0| 78 61 6d 70 6c 65 20 61 | 70 70 6c 69 63 61 74 69 |xample a|pplicati|
|000002f0| 6f 6e 20 74 68 61 74 20 | 64 65 6d 6f 6e 73 74 72 |on that |demonstr|
|00000300| 61 74 65 73 20 68 6f 77 | 20 74 6f 0d 2a 09 69 6e |ates how| to.*.in|
|00000310| 69 74 69 61 6c 69 7a 65 | 20 74 68 65 20 63 6f 6d |itialize| the com|
|00000320| 6d 6f 6e 6c 79 20 75 73 | 65 64 20 74 6f 6f 6c 62 |monly us|ed toolb|
|00000330| 6f 78 20 6d 61 6e 61 67 | 65 72 73 2c 20 6f 70 65 |ox manag|ers, ope|
|00000340| 72 61 74 65 20 0d 2a 09 | 73 75 63 63 65 73 73 66 |rate .*.|successf|
|00000350| 75 6c 6c 79 20 75 6e 64 | 65 72 20 4d 75 6c 74 69 |ully und|er Multi|
|00000360| 46 69 6e 64 65 72 2c 20 | 68 61 6e 64 6c 65 20 64 |Finder, |handle d|
|00000370| 65 73 6b 20 61 63 63 65 | 73 73 6f 72 69 65 73 2c |esk acce|ssories,|
|00000380| 20 0d 2a 09 61 6e 64 20 | 63 72 65 61 74 65 2c 20 | .*.and |create, |
|00000390| 67 72 6f 77 2c 20 61 6e | 64 20 7a 6f 6f 6d 20 77 |grow, an|d zoom w|
|000003a0| 69 6e 64 6f 77 73 2e 0d | 2a 0d 2a 09 49 74 20 64 |indows..|*.*.It d|
|000003b0| 6f 65 73 20 6e 6f 74 20 | 62 79 20 61 6e 79 20 6d |oes not |by any m|
|000003c0| 65 61 6e 73 20 64 65 6d | 6f 6e 73 74 72 61 74 65 |eans dem|onstrate|
|000003d0| 20 61 6c 6c 20 74 68 65 | 20 74 65 63 68 6e 69 71 | all the| techniq|
|000003e0| 75 65 73 20 0d 2a 09 79 | 6f 75 20 6e 65 65 64 20 |ues .*.y|ou need |
|000003f0| 66 6f 72 20 61 20 6c 61 | 72 67 65 20 61 70 70 6c |for a la|rge appl|
|00000400| 69 63 61 74 69 6f 6e 2e | 20 49 6e 20 70 61 72 74 |ication.| In part|
|00000410| 69 63 75 6c 61 72 2c 20 | 53 61 6d 70 6c 65 20 0d |icular, |Sample .|
|00000420| 2a 09 64 6f 65 73 20 6e | 6f 74 20 63 6f 76 65 72 |*.does n|ot cover|
|00000430| 20 65 78 63 65 70 74 69 | 6f 6e 20 68 61 6e 64 6c | excepti|on handl|
|00000440| 69 6e 67 2c 20 6d 75 6c | 74 69 70 6c 65 20 77 69 |ing, mul|tiple wi|
|00000450| 6e 64 6f 77 73 2f 64 6f | 63 75 6d 65 6e 74 73 2c |ndows/do|cuments,|
|00000460| 20 0d 2a 09 73 6f 70 68 | 69 73 74 69 63 61 74 65 | .*.soph|isticate|
|00000470| 64 20 6d 65 6d 6f 72 79 | 20 6d 61 6e 61 67 65 6d |d memory| managem|
|00000480| 65 6e 74 2c 20 70 72 69 | 6e 74 69 6e 67 2c 20 6f |ent, pri|nting, o|
|00000490| 72 20 75 6e 64 6f 2e 20 | 41 6c 6c 20 6f 66 20 0d |r undo. |All of .|
|000004a0| 2a 09 74 68 65 73 65 20 | 61 72 65 20 76 69 74 61 |*.these |are vita|
|000004b0| 6c 20 70 61 72 74 73 20 | 6f 66 20 61 20 6e 6f 72 |l parts |of a nor|
|000004c0| 6d 61 6c 20 66 75 6c 6c | 2d 73 69 7a 65 64 20 61 |mal full|-sized a|
|000004d0| 70 70 6c 69 63 61 74 69 | 6f 6e 2e 0d 2a 0d 2a 09 |pplicati|on..*.*.|
|000004e0| 54 68 69 73 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |This app|lication|
|000004f0| 20 69 73 20 61 6e 20 65 | 78 61 6d 70 6c 65 20 6f | is an e|xample o|
|00000500| 66 20 74 68 65 20 66 6f | 72 6d 20 6f 66 20 61 20 |f the fo|rm of a |
|00000510| 4d 61 63 69 6e 74 6f 73 | 68 20 0d 2a 09 61 70 70 |Macintos|h .*.app|
|00000520| 6c 69 63 61 74 69 6f 6e | 3b 20 69 74 20 69 73 20 |lication|; it is |
|00000530| 4e 4f 54 20 61 20 74 65 | 6d 70 6c 61 74 65 2e 20 |NOT a te|mplate. |
|00000540| 49 74 20 69 73 20 4e 4f | 54 20 69 6e 74 65 6e 64 |It is NO|T intend|
|00000550| 65 64 20 74 6f 20 62 65 | 20 0d 2a 09 75 73 65 64 |ed to be| .*.used|
|00000560| 20 61 73 20 61 20 66 6f | 75 6e 64 61 74 69 6f 6e | as a fo|undation|
|00000570| 20 66 6f 72 20 74 68 65 | 20 6e 65 78 74 20 77 6f | for the| next wo|
|00000580| 72 6c 64 2d 63 6c 61 73 | 73 2c 20 62 65 73 74 2d |rld-clas|s, best-|
|00000590| 73 65 6c 6c 69 6e 67 2c | 20 0d 2a 09 36 30 30 4b |selling,| .*.600K|
|000005a0| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 2e 20 41 20 | applica|tion. A |
|000005b0| 73 74 69 63 6b 20 66 69 | 67 75 72 65 20 64 72 61 |stick fi|gure dra|
|000005c0| 77 69 6e 67 20 6f 66 20 | 74 68 65 20 68 75 6d 61 |wing of |the huma|
|000005d0| 6e 20 62 6f 64 79 20 6d | 61 79 20 0d 2a 09 62 65 |n body m|ay .*.be|
|000005e0| 20 61 20 67 6f 6f 64 20 | 65 78 61 6d 70 6c 65 20 | a good |example |
|000005f0| 6f 66 20 74 68 65 20 66 | 6f 72 6d 20 66 6f 72 20 |of the f|orm for |
|00000600| 61 20 70 61 69 6e 74 69 | 6e 67 2c 20 62 75 74 20 |a painti|ng, but |
|00000610| 74 68 61 74 20 64 6f 65 | 73 20 6e 6f 74 20 0d 2a |that doe|s not .*|
|00000620| 09 6d 65 61 6e 20 69 74 | 20 73 68 6f 75 6c 64 20 |.mean it| should |
|00000630| 62 65 20 75 73 65 64 20 | 61 73 20 74 68 65 20 62 |be used |as the b|
|00000640| 61 73 69 73 20 66 6f 72 | 20 74 68 65 20 6e 65 78 |asis for| the nex|
|00000650| 74 20 4d 6f 6e 61 20 4c | 69 73 61 2e 0d 2a 0d 2a |t Mona L|isa..*.*|
|00000660| 09 57 65 20 72 65 63 6f | 6d 6d 65 6e 64 20 74 68 |.We reco|mmend th|
|00000670| 61 74 20 79 6f 75 20 72 | 65 76 69 65 77 20 74 68 |at you r|eview th|
|00000680| 69 73 20 70 72 6f 67 72 | 61 6d 20 6f 72 20 54 45 |is progr|am or TE|
|00000690| 53 61 6d 70 6c 65 20 62 | 65 66 6f 72 65 20 0d 2a |Sample b|efore .*|
|000006a0| 09 62 65 67 69 6e 6e 69 | 6e 67 20 61 20 6e 65 77 |.beginni|ng a new|
|000006b0| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 2e 0d 0d 2a | applica|tion...*|
|000006c0| 20 54 68 69 73 20 65 78 | 61 6d 70 6c 65 20 70 72 | This ex|ample pr|
|000006d0| 6f 67 72 61 6d 20 69 73 | 20 74 6f 20 62 65 20 63 |ogram is| to be c|
|000006e0| 6f 6e 73 69 64 65 72 65 | 64 20 61 6e 20 69 6e 74 |onsidere|d an int|
|000006f0| 72 6f 64 75 63 74 69 6f | 6e 20 74 6f 20 63 6f 64 |roductio|n to cod|
|00000700| 69 6e 67 20 69 6e 20 74 | 68 65 0d 2a 20 4d 50 57 |ing in t|he.* MPW|
|00000710| 20 41 73 73 65 6d 62 6c | 79 20 6c 61 6e 67 75 61 | Assembl|y langua|
|00000720| 67 65 2e 20 20 54 68 69 | 73 20 73 61 6d 70 6c 65 |ge. Thi|s sample|
|00000730| 20 70 72 6f 67 72 61 6d | 20 64 65 6d 6f 6e 73 74 | program| demonst|
|00000740| 72 61 74 65 73 20 74 68 | 65 20 75 73 65 20 6f 66 |rates th|e use of|
|00000750| 20 52 45 43 4f 52 44 2c | 0d 2a 20 50 52 4f 43 2c | RECORD,|.* PROC,|
|00000760| 20 57 49 54 48 2c 20 4d | 41 43 52 4f 73 2c 20 49 | WITH, M|ACROs, I|
|00000770| 4d 50 4f 52 54 2c 20 61 | 6e 64 20 6f 74 68 65 72 |MPORT, a|nd other|
|00000780| 20 63 6f 64 69 6e 67 20 | 70 72 61 63 74 69 63 65 | coding |practice|
|00000790| 73 20 75 73 65 64 20 62 | 79 20 4d 50 57 2e 20 20 |s used b|y MPW. |
|000007a0| 41 6c 74 68 6f 75 67 68 | 0d 2a 20 74 68 69 73 20 |Although|.* this |
|000007b0| 63 6f 64 65 20 77 69 6c | 6c 20 6e 6f 74 20 62 65 |code wil|l not be|
|000007c0| 20 63 6f 6d 70 61 74 69 | 62 6c 65 20 77 69 74 68 | compati|ble with|
|000007d0| 20 6f 74 68 65 72 20 61 | 73 73 65 6d 62 6c 65 72 | other a|ssembler|
|000007e0| 73 2c 20 74 68 65 72 65 | 20 69 73 20 65 6e 6f 75 |s, there| is enou|
|000007f0| 67 68 20 63 6f 64 65 0d | 2a 20 63 6f 6e 74 61 69 |gh code.|* contai|
|00000800| 6e 65 64 20 77 69 74 68 | 69 6e 20 74 68 65 20 70 |ned with|in the p|
|00000810| 72 6f 63 65 64 75 72 65 | 73 20 74 68 61 74 20 64 |rocedure|s that d|
|00000820| 65 6d 6f 6e 73 74 72 61 | 74 65 20 36 38 30 30 30 |emonstra|te 68000|
|00000830| 20 70 72 6f 67 72 61 6d | 6d 69 6e 67 20 6f 6e 20 | program|ming on |
|00000840| 74 68 65 20 4d 61 63 2e | 0d 0d 2a 20 54 68 65 20 |the Mac.|..* The |
|00000850| 6d 61 69 6e 20 70 75 72 | 70 6f 73 65 20 6f 66 20 |main pur|pose of |
|00000860| 74 68 69 73 20 65 78 61 | 6d 70 6c 65 20 69 73 20 |this exa|mple is |
|00000870| 74 6f 20 68 61 76 65 20 | 61 6e 20 65 61 73 79 20 |to have |an easy |
|00000880| 74 6f 20 75 6e 64 65 72 | 73 74 61 6e 64 20 73 61 |to under|stand sa|
|00000890| 6d 70 6c 65 0d 2a 20 61 | 73 73 65 6d 62 6c 79 20 |mple.* a|ssembly |
|000008a0| 70 72 6f 67 72 61 6d 20 | 74 68 61 74 20 66 6f 6c |program |that fol|
|000008b0| 6c 6f 77 73 20 76 65 72 | 79 20 63 6c 6f 73 65 6c |lows ver|y closel|
|000008c0| 79 20 74 68 65 20 73 61 | 6d 65 20 73 61 6d 70 6c |y the sa|me sampl|
|000008d0| 65 20 70 72 6f 67 72 61 | 6d 20 61 76 61 69 6c 61 |e progra|m availa|
|000008e0| 62 6c 65 0d 2a 20 69 6e | 20 50 61 73 63 61 6c 20 |ble.* in| Pascal |
|000008f0| 61 6e 64 20 43 2e 20 20 | 50 72 6f 67 72 61 6d 6d |and C. |Programm|
|00000900| 65 72 73 20 6e 6f 74 20 | 66 61 6d 69 6c 69 61 72 |ers not |familiar|
|00000910| 20 77 69 74 68 20 61 73 | 73 65 6d 62 6c 79 20 63 | with as|sembly c|
|00000920| 6f 64 65 20 73 68 6f 75 | 6c 64 20 72 65 66 65 72 |ode shou|ld refer|
|00000930| 20 74 6f 0d 2a 20 74 68 | 65 73 65 20 68 69 67 68 | to.* th|ese high|
|00000940| 20 6c 65 76 65 6c 20 76 | 65 72 73 69 6f 6e 73 20 | level v|ersions |
|00000950| 61 6e 64 20 66 6f 6c 6c | 6f 77 20 74 68 65 20 70 |and foll|ow the p|
|00000960| 72 6f 63 65 64 75 72 65 | 73 20 77 68 69 6c 65 20 |rocedure|s while |
|00000970| 65 78 61 6d 69 6e 69 6e | 67 20 74 68 65 20 61 73 |examinin|g the as|
|00000980| 73 65 6d 62 6c 79 0d 2a | 20 63 6f 64 65 2e 20 20 |sembly.*| code. |
|00000990| 54 68 69 73 20 69 73 20 | 61 20 67 72 65 61 74 20 |This is |a great |
|000009a0| 77 61 79 20 74 6f 20 6c | 65 61 72 6e 20 68 6f 77 |way to l|earn how|
|000009b0| 20 74 6f 20 72 65 61 64 | 20 61 73 73 65 6d 62 6c | to read| assembl|
|000009c0| 79 20 6c 69 73 74 69 6e | 67 73 2c 20 61 6e 64 20 |y listin|gs, and |
|000009d0| 74 68 61 74 20 69 73 0d | 2a 20 74 68 65 20 66 69 |that is.|* the fi|
|000009e0| 72 73 74 20 73 74 65 70 | 20 69 6e 20 75 73 69 6e |rst step| in usin|
|000009f0| 67 20 61 20 64 65 62 75 | 67 67 65 72 2e 0d 0d 2a |g a debu|gger...*|
|00000a00| 20 53 74 61 63 6b 20 66 | 72 61 6d 65 20 73 74 72 | Stack f|rame str|
|00000a10| 61 74 65 67 79 3a 0d 2a | 20 2d 2d 2d 2d 2d 2d 2d |ategy:.*| -------|
|00000a20| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000a30| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000a40| 2d 2d 2d 2d 2d 2d 2d 2d | 0d 2a 20 48 65 72 65 20 |--------|.* Here |
|00000a50| 69 73 20 61 6e 20 65 78 | 61 6d 70 6c 65 20 6f 66 |is an ex|ample of|
|00000a60| 20 61 20 74 79 70 69 63 | 61 6c 20 73 74 61 63 6b | a typic|al stack|
|00000a70| 20 66 72 61 6d 65 2e 20 | 20 41 6e 20 65 78 61 6d | frame. | An exam|
|00000a80| 70 6c 65 20 6f 66 20 74 | 68 65 20 73 74 61 63 6b |ple of t|he stack|
|00000a90| 20 66 72 61 6d 65 0d 2a | 20 52 45 43 4f 52 44 20 | frame.*| RECORD |
|00000aa0| 69 73 20 73 68 6f 77 6e | 2e 20 20 55 73 69 6e 67 |is shown|. Using|
|00000ab0| 20 74 68 69 73 20 73 74 | 72 61 74 65 67 79 20 66 | this st|rategy f|
|00000ac0| 6f 72 20 70 72 6f 63 65 | 64 75 72 65 73 20 6d 61 |or proce|dures ma|
|00000ad0| 6b 65 73 20 6c 69 66 65 | 20 6d 75 63 68 20 65 61 |kes life| much ea|
|00000ae0| 73 69 65 72 0d 2a 20 77 | 68 69 6c 65 20 77 72 69 |sier.* w|hile wri|
|00000af0| 74 69 6e 67 20 61 73 73 | 65 6d 62 6c 79 20 63 6f |ting ass|embly co|
|00000b00| 64 65 2e 20 20 54 68 65 | 20 70 72 6f 63 65 64 75 |de. The| procedu|
|00000b10| 72 65 20 6f 75 74 6c 69 | 6e 65 64 20 69 6e 20 50 |re outli|ned in P|
|00000b20| 61 73 63 61 6c 20 68 65 | 72 65 20 69 73 0d 2a 20 |ascal he|re is.* |
|00000b30| 66 6f 6c 6c 6f 77 65 64 | 20 62 79 20 74 68 65 20 |followed| by the |
|00000b40| 73 61 6d 65 20 6f 75 74 | 6c 69 6e 65 20 69 6e 20 |same out|line in |
|00000b50| 61 73 73 65 6d 62 6c 79 | 2e 0d 0d 2a 20 50 52 4f |assembly|...* PRO|
|00000b60| 43 45 44 55 52 45 20 4d | 79 50 72 6f 63 65 64 75 |CEDURE M|yProcedu|
|00000b70| 72 65 20 28 50 61 72 61 | 6d 31 3a 20 74 79 70 65 |re (Para|m1: type|
|00000b80| 2c 20 50 61 72 61 6d 32 | 3a 20 74 79 70 65 2c 20 |, Param2|: type, |
|00000b90| 50 61 72 61 6d 4e 3a 20 | 74 79 70 65 29 20 52 65 |ParamN: |type) Re|
|00000ba0| 73 75 6c 74 31 3a 20 74 | 79 70 65 3b 0d 0d 2a 20 |sult1: t|ype;..* |
|00000bb0| 56 41 52 09 4c 6f 63 61 | 6c 31 3a 20 74 79 70 65 |VAR.Loca|l1: type|
|00000bc0| 3b 0d 2a 09 4c 6f 63 61 | 6c 32 3a 20 74 79 70 65 |;.*.Loca|l2: type|
|00000bd0| 3b 0d 2a 09 4c 6f 63 61 | 6c 4e 3a 20 74 79 70 65 |;.*.Loca|lN: type|
|00000be0| 3b 0d 0d 0d 2a 20 4d 79 | 50 72 6f 63 65 64 75 72 |;...* My|Procedur|
|00000bf0| 65 09 50 52 4f 43 09 45 | 58 50 4f 52 54 09 09 09 |e.PROC.E|XPORT...|
|00000c00| 3b 20 61 6e 79 20 73 6f | 75 72 63 65 20 66 69 6c |; any so|urce fil|
|00000c10| 65 20 63 61 6e 20 75 73 | 65 20 74 68 69 73 20 72 |e can us|e this r|
|00000c20| 6f 75 74 69 6e 65 0d 0d | 2a 20 64 65 66 69 6e 65 |outine..|* define|
|00000c30| 20 72 65 67 69 73 74 6f | 72 73 20 74 68 61 74 20 | registo|rs that |
|00000c40| 6e 65 65 64 20 74 6f 20 | 62 65 20 73 61 76 65 64 |need to |be saved|
|00000c50| 20 61 73 20 45 51 55 41 | 54 45 53 20 28 74 79 70 | as EQUA|TES (typ|
|00000c60| 69 63 61 6c 6c 79 20 41 | 33 2d 41 37 20 61 6e 64 |ically A|3-A7 and|
|00000c70| 20 44 34 2d 44 37 29 0d | 0d 2a 20 53 74 61 63 6b | D4-D7).|.* Stack|
|00000c80| 46 72 61 6d 65 09 52 45 | 43 4f 52 44 09 7b 41 36 |Frame.RE|CORD.{A6|
|00000c90| 4c 69 6e 6b 7d 2c 44 45 | 43 52 09 09 3b 20 62 75 |Link},DE|CR..; bu|
|00000ca0| 69 6c 64 20 61 20 73 74 | 61 63 6b 20 66 72 61 6d |ild a st|ack fram|
|00000cb0| 65 20 72 65 63 6f 72 64 | 0d 2a 20 52 65 73 75 6c |e record|.* Resul|
|00000cc0| 74 31 09 44 53 2e 7b 73 | 69 7a 65 7d 09 09 09 3b |t1.DS.{s|ize}...;|
|00000cd0| 20 66 75 6e 63 74 69 6f | 6e 27 73 20 72 65 73 75 | functio|n's resu|
|00000ce0| 6c 74 20 72 65 74 75 72 | 6e 65 64 20 74 6f 20 63 |lt retur|ned to c|
|00000cf0| 61 6c 6c 65 72 0d 2a 20 | 50 61 72 61 6d 42 65 67 |aller.* |ParamBeg|
|00000d00| 69 6e 09 45 51 55 09 2a | 09 09 09 3b 20 73 74 61 |in.EQU.*|...; sta|
|00000d10| 72 74 20 70 61 72 61 6d | 65 74 65 72 73 20 61 66 |rt param|eters af|
|00000d20| 74 65 72 20 74 68 69 73 | 20 70 6f 69 6e 74 0d 2a |ter this| point.*|
|00000d30| 20 50 61 72 61 6d 31 09 | 44 53 2e 7b 73 69 7a 65 | Param1.|DS.{size|
|00000d40| 7d 09 09 09 3b 20 74 68 | 65 20 66 69 72 73 74 20 |}...; th|e first |
|00000d50| 70 61 72 61 6d 65 74 65 | 72 20 6f 6e 20 74 68 65 |paramete|r on the|
|00000d60| 20 73 74 61 63 6b 0d 2a | 20 50 61 72 61 6d 32 09 | stack.*| Param2.|
|00000d70| 44 53 2e 7b 73 69 7a 65 | 7d 09 09 09 3b 20 72 65 |DS.{size|}...; re|
|00000d80| 73 74 20 6f 66 20 74 68 | 65 20 70 61 72 61 6d 65 |st of th|e parame|
|00000d90| 74 65 72 73 20 70 61 73 | 73 65 64 20 62 79 20 63 |ters pas|sed by c|
|00000da0| 61 6c 6c 65 72 0d 2a 20 | 50 61 72 61 6d 4e 09 44 |aller.* |ParamN.D|
|00000db0| 53 2e 7b 73 69 7a 65 7d | 09 09 09 3b 20 74 68 65 |S.{size}|...; the|
|00000dc0| 20 6c 61 73 74 20 70 61 | 72 61 6d 65 74 65 72 20 | last pa|rameter |
|00000dd0| 70 61 73 73 65 64 20 62 | 79 20 63 61 6c 6c 65 72 |passed b|y caller|
|00000de0| 0d 2a 20 50 61 72 61 6d | 53 69 7a 65 09 45 51 55 |.* Param|Size.EQU|
|00000df0| 09 50 61 72 61 6d 42 65 | 67 69 6e 2d 2a 09 09 3b |.ParamBe|gin-*..;|
|00000e00| 20 73 69 7a 65 20 6f 66 | 20 61 6c 6c 20 74 68 65 | size of| all the|
|00000e10| 20 70 61 73 73 65 64 20 | 70 61 72 61 6d 65 74 65 | passed |paramete|
|00000e20| 72 73 0d 2a 20 52 65 74 | 41 64 64 72 20 09 44 53 |rs.* Ret|Addr .DS|
|00000e30| 2e 4c 09 31 09 09 09 3b | 20 70 6c 61 63 65 20 68 |.L.1...;| place h|
|00000e40| 6f 6c 64 65 72 20 66 6f | 72 20 72 65 74 75 72 6e |older fo|r return|
|00000e50| 20 61 64 64 72 65 73 73 | 0d 2a 20 41 36 4c 69 6e | address|.* A6Lin|
|00000e60| 6b 09 44 53 2e 4c 09 31 | 09 09 09 3b 20 70 6c 61 |k.DS.L.1|...; pla|
|00000e70| 63 65 20 68 6f 6c 64 65 | 72 20 66 6f 72 20 41 36 |ce holde|r for A6|
|00000e80| 20 6c 69 6e 6b 0d 2a 20 | 4c 6f 63 61 6c 31 09 44 | link.* |Local1.D|
|00000e90| 53 2e 7b 73 69 7a 65 7d | 09 09 09 3b 20 61 20 6c |S.{size}|...; a l|
|00000ea0| 6f 63 61 6c 20 76 61 72 | 69 61 62 6c 65 20 66 6f |ocal var|iable fo|
|00000eb0| 72 20 74 68 69 73 20 70 | 72 6f 63 65 64 75 72 65 |r this p|rocedure|
|00000ec0| 20 6f 6e 6c 79 0d 2a 20 | 4c 6f 63 61 6c 32 09 44 | only.* |Local2.D|
|00000ed0| 53 2e 7b 73 69 7a 65 7d | 09 09 09 3b 20 6f 74 68 |S.{size}|...; oth|
|00000ee0| 65 72 20 6c 6f 63 61 6c | 20 76 61 72 69 61 62 6c |er local| variabl|
|00000ef0| 65 73 20 66 6f 72 20 74 | 68 69 73 20 70 72 6f 63 |es for t|his proc|
|00000f00| 65 64 75 72 65 0d 2a 20 | 4c 6f 63 61 6c 4e 09 44 |edure.* |LocalN.D|
|00000f10| 53 2e 7b 73 69 7a 65 7d | 09 09 09 3b 20 74 68 65 |S.{size}|...; the|
|00000f20| 20 6c 61 73 74 20 6c 6f | 63 61 6c 20 76 61 72 69 | last lo|cal vari|
|00000f30| 61 62 6c 65 0d 2a 20 4c | 6f 63 61 6c 53 69 7a 65 |able.* L|ocalSize|
|00000f40| 09 45 51 55 20 09 2a 09 | 09 09 3b 20 73 69 7a 65 |.EQU .*.|..; size|
|00000f50| 20 6f 66 20 61 6c 6c 20 | 74 68 65 20 6c 6f 63 61 | of all |the loca|
|00000f60| 6c 20 76 61 72 69 61 62 | 6c 65 73 0d 2a 20 09 09 |l variab|les.* ..|
|00000f70| 45 4e 44 52 0d 0d 2a 20 | 09 09 57 49 54 48 09 53 |ENDR..* |..WITH.S|
|00000f80| 74 61 63 6b 46 72 61 6d | 65 09 09 3b 20 63 6f 76 |tackFram|e..; cov|
|00000f90| 65 72 20 6f 75 72 20 6c | 6f 63 61 6c 20 73 74 61 |er our l|ocal sta|
|00000fa0| 63 6b 20 66 72 61 6d 65 | 0d 2a 20 09 09 4c 49 4e |ck frame|.* ..LIN|
|00000fb0| 4b 09 41 36 2c 23 4c 6f | 63 61 6c 53 69 7a 65 09 |K.A6,#Lo|calSize.|
|00000fc0| 09 3b 20 61 6c 6c 6f 63 | 61 74 65 20 6f 75 72 20 |.; alloc|ate our |
|00000fd0| 6c 6f 63 61 6c 20 73 74 | 61 63 6b 20 66 72 61 6d |local st|ack fram|
|00000fe0| 65 0d 0d 2a 09 09 73 61 | 76 65 20 72 65 67 69 73 |e..*..sa|ve regis|
|00000ff0| 74 6f 72 73 20 74 72 61 | 73 68 65 64 20 62 79 20 |tors tra|shed by |
|00001000| 74 68 69 73 20 72 6f 75 | 74 69 6e 65 0d 0d 2a 20 |this rou|tine..* |
|00001010| 09 09 23 20 23 20 49 4e | 53 45 52 54 20 59 4f 55 |..# # IN|SERT YOU|
|00001020| 52 20 43 4f 44 45 20 48 | 45 52 45 20 23 20 23 0d |R CODE H|ERE # #.|
|00001030| 0d 2a 20 45 78 69 74 09 | 09 72 65 73 74 6f 72 65 |.* Exit.|.restore|
|00001040| 20 72 65 67 69 73 74 6f | 72 73 20 74 72 61 73 68 | registo|rs trash|
|00001050| 65 64 20 62 79 20 74 68 | 69 73 20 72 6f 75 74 69 |ed by th|is routi|
|00001060| 6e 65 0d 2a 20 09 09 55 | 4e 4c 4b 09 41 36 09 09 |ne.* ..U|NLK.A6..|
|00001070| 09 3b 20 64 65 73 74 72 | 6f 79 20 74 68 65 20 6c |.; destr|oy the l|
|00001080| 69 6e 6b 0d 2a 20 09 09 | 4d 4f 56 45 41 2e 4c 09 |ink.* ..|MOVEA.L.|
|00001090| 28 53 50 29 2b 2c 41 30 | 09 09 3b 20 70 75 6c 6c |(SP)+,A0|..; pull|
|000010a0| 20 6f 66 66 20 74 68 65 | 20 72 65 74 75 72 6e 20 | off the| return |
|000010b0| 61 64 64 72 65 73 73 0d | 2a 20 09 09 41 44 44 41 |address.|* ..ADDA|
|000010c0| 2e 4c 09 23 50 61 72 61 | 6d 53 69 7a 65 2c 53 50 |.L.#Para|mSize,SP|
|000010d0| 09 09 3b 20 73 74 72 69 | 70 20 61 6c 6c 20 6f 66 |..; stri|p all of|
|000010e0| 20 74 68 65 20 63 61 6c | 6c 65 72 27 73 20 70 61 | the cal|ler's pa|
|000010f0| 72 61 6d 65 74 65 72 73 | 0d 2a 20 09 09 4a 4d 50 |rameters|.* ..JMP|
|00001100| 09 28 41 30 29 09 09 09 | 3b 20 72 65 74 75 72 6e |.(A0)...|; return|
|00001110| 20 74 6f 20 74 68 65 20 | 63 61 6c 6c 65 72 0d 2a | to the |caller.*|
|00001120| 20 09 09 44 62 67 49 6e | 66 6f 09 4d 79 50 72 6f | ..DbgIn|fo.MyPro|
|00001130| 63 65 64 75 72 65 09 09 | 3b 20 74 68 69 73 20 6e |cedure..|; this n|
|00001140| 61 6d 65 20 77 69 6c 6c | 20 61 70 70 65 61 72 20 |ame will| appear |
|00001150| 69 6e 20 74 68 65 20 64 | 65 62 75 67 67 65 72 0d |in the d|ebugger.|
|00001160| 2a 20 09 09 45 4e 44 50 | 0d 0d 2a 20 54 68 65 20 |* ..ENDP|..* The |
|00001170| 4d 61 63 72 6f 20 44 62 | 67 49 6e 66 6f 20 69 73 |Macro Db|gInfo is|
|00001180| 20 6f 70 74 69 6f 6e 61 | 6c 2e 20 20 49 20 70 72 | optiona|l. I pr|
|00001190| 65 66 65 72 20 74 6f 20 | 75 73 65 20 69 74 2c 20 |efer to |use it, |
|000011a0| 73 69 6e 63 65 20 69 74 | 20 61 69 64 73 20 69 6e |since it| aids in|
|000011b0| 0d 2a 20 64 65 62 75 67 | 67 69 6e 67 2e 20 20 54 |.* debug|ging. T|
|000011c0| 68 65 72 65 20 61 72 65 | 20 6d 6f 72 65 20 6d 61 |here are| more ma|
|000011d0| 63 72 6f 73 20 69 6e 20 | 74 68 65 20 22 41 53 74 |cros in |the "ASt|
|000011e0| 72 75 63 74 4d 61 63 73 | 22 20 66 6f 6c 64 65 72 |ructMacs|" folder|
|000011f0| 20 6f 66 20 4d 50 57 2e | 20 20 50 75 74 20 6f 6e | of MPW.| Put on|
|00001200| 0d 2a 20 61 20 70 6f 74 | 20 6f 66 20 63 6f 66 66 |.* a pot| of coff|
|00001210| 65 65 20 61 6e 64 20 74 | 61 6b 65 20 61 20 6c 6f |ee and t|ake a lo|
|00001220| 6f 6b 20 61 74 20 74 68 | 65 6d 20 61 6e 64 20 74 |ok at th|em and t|
|00001230| 68 65 20 53 61 6d 70 6c | 65 20 70 72 6f 67 72 61 |he Sampl|e progra|
|00001240| 6d 20 74 68 61 74 20 75 | 73 65 73 20 74 68 65 73 |m that u|ses thes|
|00001250| 65 0d 2a 20 6d 61 63 72 | 6f 73 2e 20 20 54 68 65 |e.* macr|os. The|
|00001260| 72 65 20 69 73 20 6f 6e | 65 20 6d 61 63 72 6f 20 |re is on|e macro |
|00001270| 69 6e 20 70 61 72 74 69 | 63 75 6c 61 72 20 74 68 |in parti|cular th|
|00001280| 61 74 20 62 75 69 6c 64 | 73 20 74 68 65 20 65 6e |at build|s the en|
|00001290| 74 69 72 65 20 73 74 61 | 63 6b 20 66 72 61 6d 65 |tire sta|ck frame|
|000012a0| 0d 2a 20 73 74 72 75 63 | 74 75 72 65 20 61 73 20 |.* struc|ture as |
|000012b0| 6f 75 74 6c 69 6e 65 64 | 20 61 62 6f 76 65 2c 20 |outlined| above, |
|000012c0| 69 6e 63 6c 75 64 69 6e | 67 20 74 68 65 20 64 65 |includin|g the de|
|000012d0| 62 75 67 20 69 6e 66 6f | 2e 0d 0d 2a 20 53 65 67 |bug info|...* Seg|
|000012e0| 6d 65 6e 74 61 74 69 6f | 6e 20 73 74 72 61 74 65 |mentatio|n strate|
|000012f0| 67 79 3a 0d 2a 20 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |gy:.* --|--------|
|00001300| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001310| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001320| 2d 2d 2d 2d 2d 0d 2a 20 | 54 68 69 73 20 70 72 6f |-----.* |This pro|
|00001330| 67 72 61 6d 20 63 6f 6e | 73 69 73 74 73 20 6f 66 |gram con|sists of|
|00001340| 20 74 68 72 65 65 20 73 | 65 67 6d 65 6e 74 73 2e | three s|egments.|
|00001350| 20 4d 61 69 6e 20 63 6f | 6e 74 61 69 6e 73 20 6d | Main co|ntains m|
|00001360| 6f 73 74 20 6f 66 20 74 | 68 65 20 63 6f 64 65 2e |ost of t|he code.|
|00001370| 0d 2a 20 49 6e 69 74 69 | 61 6c 69 7a 65 20 63 6f |.* Initi|alize co|
|00001380| 6e 74 61 69 6e 73 20 63 | 6f 64 65 20 74 68 61 74 |ntains c|ode that|
|00001390| 20 69 73 20 6f 6e 6c 79 | 20 75 73 65 64 20 6f 6e | is only| used on|
|000013a0| 63 65 2c 20 64 75 72 69 | 6e 67 20 73 74 61 72 74 |ce, duri|ng start|
|000013b0| 75 70 2c 20 61 6e 64 20 | 63 61 6e 20 62 65 0d 2a |up, and |can be.*|
|000013c0| 20 75 6e 6c 6f 61 64 65 | 64 20 61 66 74 65 72 20 | unloade|d after |
|000013d0| 74 68 65 20 70 72 6f 67 | 72 61 6d 20 73 74 61 72 |the prog|ram star|
|000013e0| 74 73 2e 20 25 41 35 49 | 6e 69 74 20 69 73 20 61 |ts. %A5I|nit is a|
|000013f0| 75 74 6f 6d 61 74 69 63 | 61 6c 6c 79 20 63 72 65 |utomatic|ally cre|
|00001400| 61 74 65 64 20 62 79 20 | 74 68 65 0d 2a 20 4c 69 |ated by |the.* Li|
|00001410| 6e 6b 65 72 20 74 6f 20 | 69 6e 69 74 69 61 6c 69 |nker to |initiali|
|00001420| 7a 65 20 67 6c 6f 62 61 | 6c 73 20 61 6e 64 20 63 |ze globa|ls and c|
|00001430| 6f 6e 73 74 61 6e 74 73 | 2c 20 61 6e 64 20 69 73 |onstants|, and is|
|00001440| 20 75 6e 6c 6f 61 64 65 | 64 20 72 69 67 68 74 20 | unloade|d right |
|00001450| 61 77 61 79 2e 0d 0d 2a | 20 53 65 74 50 6f 72 74 |away...*| SetPort|
|00001460| 20 73 74 72 61 74 65 67 | 79 3a 0d 2a 20 2d 2d 2d | strateg|y:.* ---|
|00001470| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001480| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001490| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 0d 2a 20 54 |--------|----.* T|
|000014a0| 6f 6f 6c 20 62 6f 78 20 | 72 6f 75 74 69 6e 65 73 |ool box |routines|
|000014b0| 20 64 6f 20 6e 6f 74 20 | 63 68 61 6e 67 65 20 74 | do not |change t|
|000014c0| 68 65 20 63 75 72 72 65 | 6e 74 20 70 6f 72 74 2e |he curre|nt port.|
|000014d0| 20 49 6e 20 73 70 69 74 | 65 20 6f 66 20 74 68 69 | In spit|e of thi|
|000014e0| 73 2c 20 69 6e 20 74 68 | 69 73 0d 2a 20 70 72 6f |s, in th|is.* pro|
|000014f0| 67 72 61 6d 20 77 65 20 | 75 73 65 20 61 20 73 74 |gram we |use a st|
|00001500| 72 61 74 65 67 79 20 6f | 66 20 63 61 6c 6c 69 6e |rategy o|f callin|
|00001510| 67 20 53 65 74 50 6f 72 | 74 20 77 68 65 6e 65 76 |g SetPor|t whenev|
|00001520| 65 72 20 77 65 20 77 61 | 6e 74 20 74 6f 20 64 72 |er we wa|nt to dr|
|00001530| 61 77 20 6f 72 0d 2a 20 | 6d 61 6b 65 20 63 61 6c |aw or.* |make cal|
|00001540| 6c 73 20 77 68 69 63 68 | 20 64 65 70 65 6e 64 20 |ls which| depend |
|00001550| 6f 6e 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 70 |on the c|urrent p|
|00001560| 6f 72 74 2e 20 54 68 69 | 73 20 6d 61 6b 65 73 20 |ort. Thi|s makes |
|00001570| 75 73 20 6c 65 73 73 20 | 76 75 6c 6e 65 72 61 62 |us less |vulnerab|
|00001580| 6c 65 0d 2a 20 74 6f 20 | 62 75 67 73 20 69 6e 20 |le.* to |bugs in |
|00001590| 6f 74 68 65 72 20 73 6f | 66 74 77 61 72 65 20 77 |other so|ftware w|
|000015a0| 68 69 63 68 20 6d 69 67 | 68 74 20 61 6c 74 65 72 |hich mig|ht alter|
|000015b0| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 70 6f 72 | the cur|rent por|
|000015c0| 74 20 28 73 75 63 68 20 | 61 73 20 74 68 65 0d 2a |t (such |as the.*|
|000015d0| 20 62 75 67 20 28 66 65 | 61 74 75 72 65 3f 29 20 | bug (fe|ature?) |
|000015e0| 69 6e 20 6d 61 6e 79 20 | 64 65 73 6b 20 61 63 63 |in many |desk acc|
|000015f0| 65 73 73 6f 72 69 65 73 | 20 77 68 69 63 68 20 63 |essories| which c|
|00001600| 68 61 6e 67 65 20 74 68 | 65 20 70 6f 72 74 20 6f |hange th|e port o|
|00001610| 6e 20 4f 70 65 6e 44 65 | 73 6b 41 63 63 29 2e 0d |n OpenDe|skAcc)..|
|00001620| 2a 20 48 6f 70 65 66 75 | 6c 6c 79 2c 20 74 68 69 |* Hopefu|lly, thi|
|00001630| 73 20 61 6c 73 6f 20 6d | 61 6b 65 73 20 74 68 65 |s also m|akes the|
|00001640| 20 72 6f 75 74 69 6e 65 | 73 20 66 72 6f 6d 20 74 | routine|s from t|
|00001650| 68 69 73 20 70 72 6f 67 | 72 61 6d 20 6d 6f 72 65 |his prog|ram more|
|00001660| 20 73 65 6c 66 2d 63 6f | 6e 74 61 69 6e 65 64 2c | self-co|ntained,|
|00001670| 0d 2a 20 73 69 6e 63 65 | 20 74 68 65 79 20 64 6f |.* since| they do|
|00001680| 6e 27 74 20 64 65 70 65 | 6e 64 20 6f 6e 20 74 68 |n't depe|nd on th|
|00001690| 65 20 63 75 72 72 65 6e | 74 20 70 6f 72 74 20 73 |e curren|t port s|
|000016a0| 65 74 74 69 6e 67 2e 0d | 0d 2a 20 3d 3d 3d 3d 3d |etting..|.* =====|
|000016b0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000016c0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000016d0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 0d 2a 20 2d 2d |========|===.* --|
|000016e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 20 49 4e 43 |--------|---- INC|
|000016f0| 4c 55 44 45 53 20 53 45 | 43 54 49 4f 4e 20 2d 2d |LUDES SE|CTION --|
|00001700| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 0d 2a |--------|------.*|
|00001710| 20 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d | =======|========|
|00001720| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001730| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001740| 3d 0d 09 0d 09 50 52 49 | 4e 54 09 50 55 53 48 2c |=....PRI|NT.PUSH,|
|00001750| 4f 46 46 09 09 09 3b 20 | 64 6f 6e 27 74 20 70 72 |OFF...; |don't pr|
|00001760| 69 6e 74 20 61 6e 79 20 | 6f 66 20 74 68 69 73 20 |int any |of this |
|00001770| 73 74 75 66 66 0d 0d 09 | 49 4e 43 4c 55 44 45 09 |stuff...|INCLUDE.|
|00001780| 27 54 6f 6f 6c 45 71 75 | 2e 61 27 0d 09 49 4e 43 |'ToolEqu|.a'..INC|
|00001790| 4c 55 44 45 09 27 54 72 | 61 70 73 2e 61 27 0d 09 |LUDE.'Tr|aps.a'..|
|000017a0| 49 4e 43 4c 55 44 45 09 | 27 50 61 63 6b 4d 61 63 |INCLUDE.|'PackMac|
|000017b0| 73 2e 61 27 0d 09 49 4e | 43 4c 55 44 45 09 27 51 |s.a'..IN|CLUDE.'Q|
|000017c0| 75 69 63 6b 45 71 75 2e | 61 27 0d 09 49 4e 43 4c |uickEqu.|a'..INCL|
|000017d0| 55 44 45 09 27 53 79 73 | 45 71 75 2e 61 27 0d 09 |UDE.'Sys|Equ.a'..|
|000017e0| 49 4e 43 4c 55 44 45 09 | 27 53 61 6d 70 6c 65 2e |INCLUDE.|'Sample.|
|000017f0| 69 6e 63 31 2e 61 27 09 | 09 09 3b 20 61 6c 6c 20 |inc1.a'.|..; all |
|00001800| 6f 75 72 20 6d 61 63 72 | 6f 73 20 61 6e 64 20 64 |our macr|os and d|
|00001810| 61 74 61 20 74 65 6d 70 | 6c 61 74 65 73 0d 0d 09 |ata temp|lates...|
|00001820| 50 52 49 4e 54 09 50 4f | 50 09 09 09 09 3b 20 72 |PRINT.PO|P....; r|
|00001830| 65 73 74 6f 72 65 20 74 | 68 65 20 50 52 49 4e 54 |estore t|he PRINT|
|00001840| 20 6f 70 74 69 6f 6e 73 | 0d 09 0d 0d 2a 20 3d 3d | options|....* ==|
|00001850| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001860| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001870| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 0d 2a |========|======.*|
|00001880| 20 2d 2d 2d 2d 2d 2d 2d | 2d 2d 20 20 44 41 54 41 | -------|-- DATA|
|00001890| 20 53 54 4f 52 41 47 45 | 20 41 4c 4c 4f 43 41 54 | STORAGE| ALLOCAT|
|000018a0| 49 4f 4e 20 20 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |ION ---|--------|
|000018b0| 2d 0d 2a 20 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |-.* ====|========|
|000018c0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000018d0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000018e0| 3d 3d 3d 3d 0d 2a 20 47 | 6c 6f 62 61 6c 20 64 61 |====.* G|lobal da|
|000018f0| 74 61 20 73 74 6f 72 61 | 67 65 2e 20 20 41 6c 6c |ta stora|ge. All|
|00001900| 20 67 6c 6f 62 61 6c 20 | 6d 65 6d 6f 72 79 20 69 | global |memory i|
|00001910| 73 20 61 6c 6c 6f 63 61 | 74 65 64 20 68 65 72 65 |s alloca|ted here|
|00001920| 2e 20 20 54 68 65 0d 2a | 20 4c 69 6e 6b 65 72 20 |. The.*| Linker |
|00001930| 77 69 6c 6c 20 6c 6f 61 | 64 20 61 6c 6c 20 67 6c |will loa|d all gl|
|00001940| 6f 62 61 6c 20 64 61 74 | 61 20 6f 66 66 73 65 74 |obal dat|a offset|
|00001950| 20 66 72 6f 6d 20 41 35 | 2c 20 61 6e 64 20 74 68 | from A5|, and th|
|00001960| 65 20 41 73 6d 20 6b 6e | 6f 77 73 20 74 68 69 73 |e Asm kn|ows this|
|00001970| 2e 0d 2a 20 54 68 65 72 | 65 66 6f 72 65 2c 20 6e |..* Ther|efore, n|
|00001980| 6f 20 72 65 66 65 72 65 | 6e 63 65 20 74 6f 20 28 |o refere|nce to (|
|00001990| 41 35 29 20 69 73 20 72 | 65 71 75 69 72 65 64 20 |A5) is r|equired |
|000019a0| 69 6e 20 74 68 65 20 63 | 6f 64 65 2e 20 48 6f 6f |in the c|ode. Hoo|
|000019b0| 72 61 79 21 0d 2a 20 48 | 65 72 65 20 77 65 20 64 |ray!.* H|ere we d|
|000019c0| 65 63 6c 61 72 65 20 74 | 77 6f 20 64 61 74 61 20 |eclare t|wo data |
|000019d0| 73 74 72 75 63 74 75 72 | 65 73 20 75 73 69 6e 67 |structur|es using|
|000019e0| 20 6f 75 72 20 74 65 6d | 70 6c 61 74 65 73 20 64 | our tem|plates d|
|000019f0| 65 66 69 6e 65 64 20 70 | 72 65 76 69 6f 75 73 6c |efined p|reviousl|
|00001a00| 79 2e 0d 2a 20 54 68 65 | 79 20 6d 75 73 74 20 62 |y..* The|y must b|
|00001a10| 65 20 45 58 50 4f 52 54 | 65 64 20 68 65 72 65 20 |e EXPORT|ed here |
|00001a20| 66 6f 72 20 6f 74 68 65 | 72 20 66 69 6c 65 73 20 |for othe|r files |
|00001a30| 74 68 61 74 20 6e 65 65 | 64 20 74 6f 20 49 4d 50 |that nee|d to IMP|
|00001a40| 4f 52 54 20 74 68 65 6d | 2e 0d 0d 09 09 45 58 50 |ORT them|.....EXP|
|00001a50| 4f 52 54 09 28 51 44 2c | 47 29 3a 44 41 54 41 0d |ORT.(QD,|G):DATA.|
|00001a60| 0d 51 44 09 09 44 53 09 | 51 44 47 6c 6f 62 61 6c |.QD..DS.|QDGlobal|
|00001a70| 73 09 09 3b 20 51 75 69 | 63 6b 44 72 61 77 27 73 |s..; Qui|ckDraw's|
|00001a80| 20 67 6c 6f 62 61 6c 73 | 0d 47 09 09 44 53 09 41 | globals|.G..DS.A|
|00001a90| 70 70 47 6c 6f 62 61 6c | 73 09 09 3b 20 61 70 70 |ppGlobal|s..; app|
|00001aa0| 6c 69 63 61 74 69 6f 6e | 27 73 20 67 6c 6f 62 61 |lication|'s globa|
|00001ab0| 6c 73 0d 0d 0d 2a 20 3d | 3d 3d 3d 3d 3d 3d 3d 3d |ls...* =|========|
|00001ac0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001ad0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001ae0| 3d 3d 3d 3d 3d 3d 3d 0d | 2a 20 50 52 4f 43 45 44 |=======.|* PROCED|
|00001af0| 55 52 45 20 49 6e 69 74 | 69 61 6c 69 7a 65 3b 0d |URE Init|ialize;.|
|00001b00| 2a 20 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |* ======|========|
|00001b10| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001b20| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001b30| 3d 3d 0d 2a 20 53 65 74 | 20 75 70 20 74 68 65 20 |==.* Set| up the |
|00001b40| 77 68 6f 6c 65 20 77 6f | 72 6c 64 2c 20 69 6e 63 |whole wo|rld, inc|
|00001b50| 6c 75 64 69 6e 67 20 67 | 6c 6f 62 61 6c 20 76 61 |luding g|lobal va|
|00001b60| 72 69 61 62 6c 65 73 2c | 20 54 6f 6f 6c 62 6f 78 |riables,| Toolbox|
|00001b70| 20 6d 61 6e 61 67 65 72 | 73 2c 20 61 6e 64 20 6d | manager|s, and m|
|00001b80| 65 6e 75 73 2e 0d 2a 20 | 43 68 65 63 6b 20 74 6f |enus..* |Check to|
|00001b90| 20 73 65 65 20 69 66 20 | 61 20 67 69 76 65 6e 20 | see if |a given |
|00001ba0| 74 72 61 70 20 69 73 20 | 69 6d 70 6c 65 6d 65 6e |trap is |implemen|
|00001bb0| 74 65 64 2e 20 54 68 65 | 20 72 65 63 6f 6d 6d 65 |ted. The| recomme|
|00001bc0| 6e 64 65 64 20 61 70 70 | 72 6f 61 63 68 20 74 6f |nded app|roach to|
|00001bd0| 20 73 65 65 20 69 66 0d | 2a 20 61 20 74 72 61 70 | see if.|* a trap|
|00001be0| 20 69 73 20 69 6d 70 6c | 65 6d 65 6e 74 65 64 20 | is impl|emented |
|00001bf0| 69 73 20 74 6f 20 73 65 | 65 20 69 66 20 74 68 65 |is to se|e if the|
|00001c00| 20 61 64 64 72 65 73 73 | 20 6f 66 20 74 68 65 20 | address| of the |
|00001c10| 74 72 61 70 20 72 6f 75 | 74 69 6e 65 20 69 73 20 |trap rou|tine is |
|00001c20| 74 68 65 20 73 61 6d 65 | 0d 2a 20 61 73 20 74 68 |the same|.* as th|
|00001c30| 65 20 61 64 64 72 65 73 | 73 20 6f 66 20 74 68 65 |e addres|s of the|
|00001c40| 20 55 6e 69 6d 70 6c 65 | 6d 65 6e 74 65 64 20 74 | Unimple|mented t|
|00001c50| 72 61 70 2e 20 20 57 65 | 20 61 6c 73 6f 20 63 72 |rap. We| also cr|
|00001c60| 65 61 74 65 20 6f 75 72 | 20 6f 6e 65 20 61 70 70 |eate our| one app|
|00001c70| 6c 69 63 61 74 69 6f 6e | 0d 2a 20 77 69 6e 64 6f |lication|.* windo|
|00001c80| 77 20 61 74 20 74 68 69 | 73 20 74 69 6d 65 2e 20 |w at thi|s time. |
|00001c90| 20 53 69 6e 63 65 20 77 | 69 6e 64 6f 77 20 73 74 | Since w|indow st|
|00001ca0| 6f 72 61 67 65 20 69 73 | 20 6e 6f 6e 2d 72 65 6c |orage is| non-rel|
|00001cb0| 6f 63 61 74 65 61 62 6c | 65 2c 20 68 6f 77 20 61 |ocateabl|e, how a|
|00001cc0| 6e 64 20 77 68 65 6e 20 | 74 6f 0d 2a 20 61 6c 6c |nd when |to.* all|
|00001cd0| 6f 63 61 74 65 20 73 70 | 61 63 65 20 66 6f 72 20 |ocate sp|ace for |
|00001ce0| 77 69 6e 64 6f 77 73 20 | 69 73 20 76 65 72 79 20 |windows |is very |
|00001cf0| 69 6d 70 6f 72 74 61 6e | 74 20 73 6f 20 74 68 61 |importan|t so tha|
|00001d00| 74 20 68 65 61 70 20 66 | 72 61 67 6d 65 6e 74 61 |t heap f|ragmenta|
|00001d10| 74 69 6f 6e 20 64 6f 65 | 73 20 6e 6f 74 0d 2a 20 |tion doe|s not.* |
|00001d20| 6f 63 63 75 72 2e 20 20 | 42 65 63 61 75 73 65 20 |occur. |Because |
|00001d30| 53 61 6d 70 6c 65 20 68 | 61 73 20 6f 6e 6c 79 20 |Sample h|as only |
|00001d40| 6f 6e 65 20 77 69 6e 64 | 6f 77 20 61 6e 64 20 69 |one wind|ow and i|
|00001d50| 74 20 69 73 20 6f 6e 6c | 79 20 64 69 73 70 6f 73 |t is onl|y dispos|
|00001d60| 65 64 20 77 68 65 6e 20 | 74 68 65 0d 2a 20 61 70 |ed when |the.* ap|
|00001d70| 70 6c 69 63 61 74 69 6f | 6e 20 71 75 69 74 73 2c |plicatio|n quits,|
|00001d80| 20 77 65 20 77 69 6c 6c | 20 61 6c 6c 6f 63 61 74 | we will| allocat|
|00001d90| 65 20 69 74 73 20 73 70 | 61 63 65 20 68 65 72 65 |e its sp|ace here|
|00001da0| 2c 20 62 65 66 6f 72 65 | 20 61 6e 79 74 68 69 6e |, before| anythin|
|00001db0| 67 20 74 68 61 74 20 6d | 69 67 68 74 0d 2a 20 62 |g that m|ight.* b|
|00001dc0| 65 20 61 20 6c 6f 63 6b | 65 64 20 72 65 6c 6f 63 |e a lock|ed reloc|
|00001dd0| 61 74 61 62 6c 65 20 6f | 62 6a 65 63 74 20 67 65 |atable o|bject ge|
|00001de0| 74 73 20 69 6e 74 6f 20 | 74 68 65 20 68 65 61 70 |ts into |the heap|
|00001df0| 2e 20 54 68 69 73 20 77 | 61 79 2c 20 77 65 20 63 |. This w|ay, we c|
|00001e00| 61 6e 20 66 6f 72 63 65 | 20 69 74 73 0d 2a 20 73 |an force| its.* s|
|00001e10| 74 6f 72 61 67 65 20 74 | 6f 20 62 65 20 69 6e 20 |torage t|o be in |
|00001e20| 74 68 65 20 6c 6f 77 65 | 73 74 20 6d 65 6d 6f 72 |the lowe|st memor|
|00001e30| 79 20 61 76 61 69 6c 61 | 62 6c 65 20 69 6e 20 74 |y availa|ble in t|
|00001e40| 68 65 20 68 65 61 70 2e | 20 57 69 6e 64 6f 77 20 |he heap.| Window |
|00001e50| 73 74 6f 72 61 67 65 20 | 63 61 6e 0d 2a 20 64 69 |storage |can.* di|
|00001e60| 66 66 65 72 20 77 69 64 | 65 6c 79 20 61 6d 6f 6e |ffer wid|ely amon|
|00001e70| 67 73 74 20 61 70 70 6c | 69 63 61 74 69 6f 6e 73 |gst appl|ications|
|00001e80| 20 64 65 70 65 6e 64 69 | 6e 67 20 6f 6e 20 68 6f | dependi|ng on ho|
|00001e90| 77 20 6d 61 6e 79 20 77 | 69 6e 64 6f 77 73 20 61 |w many w|indows a|
|00001ea0| 72 65 20 63 72 65 61 74 | 65 64 0d 2a 20 61 6e 64 |re creat|ed.* and|
|00001eb0| 20 64 69 73 70 6f 73 65 | 64 2e 20 20 49 66 20 61 | dispose|d. If a|
|00001ec0| 20 66 61 69 6c 75 72 65 | 20 6f 63 63 75 72 73 20 | failure| occurs |
|00001ed0| 68 65 72 65 2c 20 77 65 | 20 77 69 6c 6c 20 63 6f |here, we| will co|
|00001ee0| 6e 73 69 64 65 72 20 74 | 68 61 74 20 74 68 65 20 |nsider t|hat the |
|00001ef0| 61 70 70 6c 69 63 61 74 | 69 6f 6e 0d 2a 20 69 73 |applicat|ion.* is|
|00001f00| 20 69 6e 20 73 75 63 68 | 20 62 61 64 20 73 68 61 | in such| bad sha|
|00001f10| 70 65 20 74 68 61 74 20 | 77 65 20 73 68 6f 75 6c |pe that |we shoul|
|00001f20| 64 20 6a 75 73 74 20 65 | 78 69 74 2e 20 59 6f 75 |d just e|xit. You|
|00001f30| 72 20 65 72 72 6f 72 20 | 68 61 6e 64 6c 69 6e 67 |r error |handling|
|00001f40| 20 6d 61 79 20 64 69 66 | 66 65 72 2c 0d 2a 20 62 | may dif|fer,.* b|
|00001f50| 75 74 20 74 68 65 20 63 | 68 65 63 6b 73 20 73 68 |ut the c|hecks sh|
|00001f60| 6f 75 6c 64 20 73 74 69 | 6c 6c 20 62 65 20 6d 61 |ould sti|ll be ma|
|00001f70| 64 65 2e 0d 0d 2a 20 49 | 66 20 61 6e 20 65 72 72 |de...* I|f an err|
|00001f80| 6f 72 20 69 73 20 64 65 | 74 65 63 74 65 64 2c 20 |or is de|tected, |
|00001f90| 69 6e 73 74 65 61 64 20 | 6f 66 20 6d 65 72 65 6c |instead |of merel|
|00001fa0| 79 20 64 6f 69 6e 67 20 | 61 6e 20 45 78 69 74 54 |y doing |an ExitT|
|00001fb0| 6f 53 68 65 6c 6c 2c 20 | 77 68 69 63 68 20 6c 65 |oShell, |which le|
|00001fc0| 61 76 65 73 0d 2a 20 74 | 68 65 20 75 73 65 72 20 |aves.* t|he user |
|00001fd0| 77 69 74 68 6f 75 74 20 | 6d 75 63 68 20 74 6f 20 |without |much to |
|00001fe0| 67 6f 20 6f 6e 2c 20 77 | 65 20 63 61 6c 6c 20 41 |go on, w|e call A|
|00001ff0| 6c 65 72 74 55 73 65 72 | 2c 20 77 68 69 63 68 20 |lertUser|, which |
|00002000| 70 75 74 73 20 75 70 20 | 61 20 73 69 6d 70 6c 65 |puts up |a simple|
|00002010| 20 61 6c 65 72 74 0d 2a | 20 74 68 61 74 20 6a 75 | alert.*| that ju|
|00002020| 73 74 20 73 61 79 73 20 | 61 6e 20 65 72 72 6f 72 |st says |an error|
|00002030| 20 6f 63 63 75 72 72 65 | 64 20 61 6e 64 20 74 68 | occurre|d and th|
|00002040| 65 6e 20 63 61 6c 6c 73 | 20 45 78 69 74 54 6f 53 |en calls| ExitToS|
|00002050| 68 65 6c 6c 2e 20 20 49 | 6e 20 74 68 65 20 69 6e |hell. I|n the in|
|00002060| 74 65 72 65 73 74 73 0d | 2a 20 6f 66 20 6b 65 65 |terests.|* of kee|
|00002070| 70 69 6e 67 20 74 68 69 | 6e 67 73 20 73 69 6d 70 |ping thi|ngs simp|
|00002080| 6c 65 2c 20 74 68 65 20 | 61 6c 65 72 74 20 64 6f |le, the |alert do|
|00002090| 65 73 20 6e 6f 74 20 73 | 74 61 74 65 20 74 68 65 |es not s|tate the|
|000020a0| 20 73 70 65 63 69 66 69 | 63 20 63 61 75 73 65 20 | specifi|c cause |
|000020b0| 6f 66 20 74 68 65 20 65 | 72 72 6f 72 2c 0d 2a 20 |of the e|rror,.* |
|000020c0| 62 75 74 20 61 20 6d 6f | 72 65 20 69 6e 66 6f 72 |but a mo|re infor|
|000020d0| 6d 61 74 69 76 65 20 61 | 6c 65 72 74 20 77 6f 75 |mative a|lert wou|
|000020e0| 6c 64 20 62 65 20 61 70 | 70 72 6f 70 72 69 61 74 |ld be ap|propriat|
|000020f0| 65 20 66 6f 72 20 6d 6f | 72 65 20 73 6f 70 68 69 |e for mo|re sophi|
|00002100| 73 74 69 63 61 74 65 64 | 20 61 70 70 6c 69 63 61 |sticated| applica|
|00002110| 74 69 6f 6e 73 2e 0d 2a | 20 53 69 6e 63 65 20 74 |tions..*| Since t|
|00002120| 68 65 72 65 20 69 73 20 | 6e 6f 20 6f 74 68 65 72 |here is |no other|
|00002130| 20 63 6c 65 61 6e 75 70 | 20 6e 65 65 64 65 64 20 | cleanup| needed |
|00002140| 61 74 20 74 68 69 73 20 | 70 6f 69 6e 74 20 69 66 |at this |point if|
|00002150| 20 61 6e 20 65 72 72 6f | 72 20 69 73 20 64 65 74 | an erro|r is det|
|00002160| 65 63 74 65 64 2c 20 74 | 68 69 73 0d 2a 20 66 6f |ected, t|his.* fo|
|00002170| 72 6d 20 6f 66 20 65 72 | 72 6f 72 2d 20 68 61 6e |rm of er|ror- han|
|00002180| 64 6c 69 6e 67 20 69 73 | 20 61 63 63 65 70 74 61 |dling is| accepta|
|00002190| 62 6c 65 2e 20 49 66 20 | 6d 6f 72 65 20 73 6f 70 |ble. If |more sop|
|000021a0| 68 69 73 74 69 63 61 74 | 65 64 20 65 72 72 6f 72 |histicat|ed error|
|000021b0| 20 72 65 63 6f 76 65 72 | 79 20 69 73 20 6e 65 65 | recover|y is nee|
|000021c0| 64 65 64 2c 0d 2a 20 61 | 20 73 69 67 6e 61 6c 20 |ded,.* a| signal |
|000021d0| 6d 65 63 68 61 6e 69 73 | 6d 2c 20 73 75 63 68 20 |mechanis|m, such |
|000021e0| 61 73 20 69 73 20 70 72 | 6f 76 69 64 65 64 20 62 |as is pr|ovided b|
|000021f0| 79 20 53 69 67 6e 61 6c | 73 2c 20 63 61 6e 20 62 |y Signal|s, can b|
|00002200| 65 20 75 73 65 64 2e 0d | 0d 2a 20 53 6f 6d 65 74 |e used..|.* Somet|
|00002210| 68 69 6e 67 20 77 6f 72 | 74 68 20 6e 6f 74 69 6e |hing wor|th notin|
|00002220| 67 20 68 65 72 65 2e 20 | 20 53 69 6e 63 65 20 74 |g here. | Since t|
|00002230| 68 65 20 41 6c 65 72 74 | 55 73 65 72 20 72 6f 75 |he Alert|User rou|
|00002240| 74 69 6e 65 20 69 73 20 | 69 6e 20 61 20 64 69 66 |tine is |in a dif|
|00002250| 66 65 72 65 6e 74 20 73 | 65 67 6d 65 6e 74 2c 0d |ferent s|egment,.|
|00002260| 2a 20 77 65 20 68 61 76 | 65 20 74 6f 20 75 73 65 |* we hav|e to use|
|00002270| 20 61 20 4a 75 6d 70 20 | 69 6e 73 74 72 75 63 74 | a Jump |instruct|
|00002280| 69 6f 6e 20 74 6f 20 67 | 65 74 20 74 68 65 72 65 |ion to g|et there|
|00002290| 2e 20 20 49 6e 20 6f 74 | 68 65 72 20 77 6f 72 64 |. In ot|her word|
|000022a0| 73 2c 20 77 65 20 6d 75 | 73 74 20 67 6f 20 74 68 |s, we mu|st go th|
|000022b0| 72 6f 75 67 68 20 74 68 | 65 0d 2a 20 6a 75 6d 70 |rough th|e.* jump|
|000022c0| 20 74 61 62 6c 65 2e 20 | 20 54 68 69 73 20 63 61 | table. | This ca|
|000022d0| 75 73 65 73 20 65 78 74 | 72 61 20 74 65 73 74 20 |uses ext|ra test |
|000022e0| 61 6e 64 20 62 72 61 6e | 63 68 20 69 6e 73 74 72 |and bran|ch instr|
|000022f0| 75 63 74 69 6f 6e 73 20 | 74 6f 20 67 65 74 20 6f |uctions |to get o|
|00002300| 76 65 72 20 74 68 65 20 | 4a 4d 50 20 41 6c 65 72 |ver the |JMP Aler|
|00002310| 74 55 73 65 72 2e 0d 0d | 09 09 53 45 47 20 27 49 |tUser...|..SEG 'I|
|00002320| 6e 69 74 69 61 6c 69 7a | 65 27 09 09 3b 20 63 61 |nitializ|e'..; ca|
|00002330| 73 65 20 73 65 6e 73 69 | 74 69 76 65 0d 49 6e 69 |se sensi|tive.Ini|
|00002340| 74 69 61 6c 69 7a 65 09 | 50 52 4f 43 09 09 09 09 |tialize.|PROC....|
|00002350| 3b 20 49 6e 69 74 69 61 | 6c 69 7a 65 20 65 76 65 |; Initia|lize eve|
|00002360| 72 79 74 68 69 6e 67 0d | 0d 54 72 61 70 41 64 72 |rything.|.TrapAdr|
|00002370| 73 52 65 67 09 45 51 55 | 09 41 33 09 09 09 3b 20 |sReg.EQU|.A3...; |
|00002380| 74 65 6d 70 6f 72 61 72 | 79 20 72 65 67 69 73 74 |temporar|y regist|
|00002390| 6f 72 20 74 6f 20 74 65 | 73 74 20 74 72 61 70 20 |or to te|st trap |
|000023a0| 61 64 64 72 65 73 73 0d | 43 6f 75 6e 74 52 65 67 |address.|CountReg|
|000023b0| 09 45 51 55 09 44 34 09 | 09 09 3b 20 74 65 6d 70 |.EQU.D4.|..; temp|
|000023c0| 6f 72 61 72 79 20 72 65 | 67 69 73 74 6f 72 20 74 |orary re|gistor t|
|000023d0| 6f 20 63 6f 75 6e 74 20 | 6c 6f 6f 70 73 0d 0d 53 |o count |loops..S|
|000023e0| 74 61 63 6b 46 72 61 6d | 65 09 52 45 43 4f 52 44 |tackFram|e.RECORD|
|000023f0| 09 7b 41 36 4c 69 6e 6b | 7d 2c 44 45 43 52 09 09 |.{A6Link|},DECR..|
|00002400| 3b 20 62 75 69 6c 64 20 | 61 20 73 74 61 63 6b 20 |; build |a stack |
|00002410| 66 72 61 6d 65 20 72 65 | 63 6f 72 64 0d 50 61 72 |frame re|cord.Par|
|00002420| 61 6d 42 65 67 69 6e 09 | 45 51 55 09 2a 09 09 09 |amBegin.|EQU.*...|
|00002430| 3b 20 73 74 61 72 74 20 | 70 61 72 61 6d 65 74 65 |; start |paramete|
|00002440| 72 73 20 61 66 74 65 72 | 20 74 68 69 73 20 70 6f |rs after| this po|
|00002450| 69 6e 74 0d 50 61 72 61 | 6d 53 69 7a 65 09 45 51 |int.Para|mSize.EQ|
|00002460| 55 09 50 61 72 61 6d 42 | 65 67 69 6e 2d 2a 09 09 |U.ParamB|egin-*..|
|00002470| 3b 20 73 69 7a 65 20 6f | 66 20 61 6c 6c 20 74 68 |; size o|f all th|
|00002480| 65 20 70 61 73 73 65 64 | 20 70 61 72 61 6d 65 74 |e passed| paramet|
|00002490| 65 72 73 0d 52 65 74 41 | 64 64 72 20 09 44 53 2e |ers.RetA|ddr .DS.|
|000024a0| 4c 09 31 09 09 09 3b 20 | 70 6c 61 63 65 20 68 6f |L.1...; |place ho|
|000024b0| 6c 64 65 72 20 66 6f 72 | 20 72 65 74 75 72 6e 20 |lder for| return |
|000024c0| 61 64 64 72 65 73 73 0d | 41 36 4c 69 6e 6b 09 09 |address.|A6Link..|
|000024d0| 44 53 2e 4c 09 31 09 09 | 09 3b 20 70 6c 61 63 65 |DS.L.1..|.; place|
|000024e0| 20 68 6f 6c 64 65 72 20 | 66 6f 72 20 41 36 20 6c | holder |for A6 l|
|000024f0| 69 6e 6b 0d 43 75 72 4d | 42 61 72 09 09 44 53 2e |ink.CurM|Bar..DS.|
|00002500| 4c 09 31 09 09 09 3b 20 | 6c 6f 63 61 6c 20 68 61 |L.1...; |local ha|
|00002510| 6e 64 6c 65 20 74 6f 20 | 6f 75 72 20 6d 65 6e 75 |ndle to |our menu|
|00002520| 62 61 72 0d 54 68 65 45 | 76 65 6e 74 20 09 44 53 |bar.TheE|vent .DS|
|00002530| 09 45 76 65 6e 74 52 65 | 63 6f 72 64 20 09 09 3b |.EventRe|cord ..;|
|00002540| 20 6c 6f 63 61 6c 20 63 | 6f 70 79 20 6f 66 20 74 | local c|opy of t|
|00002550| 68 65 20 65 76 65 6e 74 | 20 72 65 63 6f 72 64 0d |he event| record.|
|00002560| 4c 6f 63 61 6c 53 69 7a | 65 09 45 51 55 20 09 2a |LocalSiz|e.EQU .*|
|00002570| 09 09 09 3b 20 73 69 7a | 65 20 6f 66 20 61 6c 6c |...; siz|e of all|
|00002580| 20 74 68 65 20 6c 6f 63 | 61 6c 20 76 61 72 69 61 | the loc|al varia|
|00002590| 62 6c 65 73 0d 09 09 45 | 4e 44 52 0d 09 09 0d 09 |bles...E|NDR.....|
|000025a0| 09 49 4d 50 4f 52 54 09 | 47 6f 47 65 74 52 65 63 |.IMPORT.|GoGetRec|
|000025b0| 74 2c 41 6c 65 72 74 55 | 73 65 72 2c 09 5c 0d 09 |t,AlertU|ser,.\..|
|000025c0| 09 09 53 79 73 45 6e 76 | 69 72 6f 6e 73 09 09 3b |..SysEnv|irons..;|
|000025d0| 20 6c 69 6e 6b 65 64 20 | 69 6e 20 77 69 74 68 20 | linked |in with |
|000025e0| 49 6e 74 65 72 66 61 63 | 65 2e 6f 0d 0d 09 09 57 |Interfac|e.o....W|
|000025f0| 49 54 48 09 53 74 61 63 | 6b 46 72 61 6d 65 09 09 |ITH.Stac|kFrame..|
|00002600| 3b 20 63 6f 76 65 72 20 | 6f 75 72 20 6c 6f 63 61 |; cover |our loca|
|00002610| 6c 20 73 74 61 63 6b 20 | 66 72 61 6d 65 0d 09 09 |l stack |frame...|
|00002620| 4c 49 4e 4b 09 41 36 2c | 23 4c 6f 63 61 6c 53 69 |LINK.A6,|#LocalSi|
|00002630| 7a 65 09 09 3b 20 61 6c | 6c 6f 63 61 74 65 20 6f |ze..; al|locate o|
|00002640| 75 72 20 6c 6f 63 61 6c | 20 73 74 61 63 6b 20 66 |ur local| stack f|
|00002650| 72 61 6d 65 0d 09 09 0d | 09 09 4d 4f 56 45 4d 2e |rame....|..MOVEM.|
|00002660| 4c 09 43 6f 75 6e 74 52 | 65 67 2f 54 72 61 70 41 |L.CountR|eg/TrapA|
|00002670| 64 72 73 52 65 67 2c 2d | 28 53 50 29 20 3b 20 73 |drsReg,-|(SP) ; s|
|00002680| 61 76 65 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 |ave the |current |
|00002690| 72 65 67 69 73 74 6f 72 | 20 76 61 6c 75 65 73 0d |registor| values.|
|000026a0| 09 09 4d 4f 56 45 2e 57 | 09 23 46 61 6c 73 65 2c |..MOVE.W|.#False,|
|000026b0| 47 2e 48 61 73 57 4e 45 | 76 65 6e 74 09 3b 20 69 |G.HasWNE|vent.; i|
|000026c0| 6e 69 74 69 61 6c 69 7a | 65 20 69 74 20 61 73 20 |nitializ|e it as |
|000026d0| 46 61 6c 73 65 0d 09 09 | 4d 4f 56 45 2e 57 09 23 |False...|MOVE.W.#|
|000026e0| 46 61 6c 73 65 2c 47 2e | 49 6e 42 61 63 6b 67 72 |False,G.|InBackgr|
|000026f0| 6f 75 6e 64 09 3b 20 77 | 65 20 73 74 61 72 74 20 |ound.; w|e start |
|00002700| 6f 75 74 20 69 6e 20 74 | 68 65 20 66 6f 72 65 67 |out in t|he foreg|
|00002710| 72 6f 75 6e 64 0d 09 09 | 4d 4f 56 45 2e 57 09 23 |round...|MOVE.W.#|
|00002720| 54 72 75 65 2c 47 2e 53 | 74 6f 70 70 65 64 09 09 |True,G.S|topped..|
|00002730| 3b 20 77 65 27 6c 6c 20 | 73 74 61 72 74 20 77 69 |; we'll |start wi|
|00002740| 74 68 20 74 68 65 20 72 | 65 64 20 6c 69 67 68 74 |th the r|ed light|
|00002750| 20 6f 6e 0d 09 09 0d 2a | 20 2d 2d 2d 2d 2d 2d 2d | on....*| -------|
|00002760| 2d 2d 2d 2d 2d 2d 20 54 | 45 53 54 20 46 4f 52 20 |------ T|EST FOR |
|00002770| 57 41 49 54 4e 45 58 54 | 45 56 45 4e 54 20 2d 2d |WAITNEXT|EVENT --|
|00002780| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 0d 0d 09 09 4d |--------|---....M|
|00002790| 4f 56 45 2e 57 09 23 57 | 61 69 74 4e 65 78 74 45 |OVE.W.#W|aitNextE|
|000027a0| 76 65 6e 74 2c 44 30 09 | 3b 20 67 65 74 20 61 64 |vent,D0.|; get ad|
|000027b0| 64 72 65 73 73 20 6f 66 | 20 57 61 69 74 4e 65 78 |dress of| WaitNex|
|000027c0| 74 45 76 65 6e 74 20 74 | 72 61 70 0d 09 09 5f 47 |tEvent t|rap..._G|
|000027d0| 65 74 54 72 61 70 41 64 | 64 72 65 73 73 20 2c 4e |etTrapAd|dress ,N|
|000027e0| 65 77 54 6f 6f 6c 09 3b | 20 74 72 61 70 20 6d 61 |ewTool.;| trap ma|
|000027f0| 63 72 6f 0d 09 09 4d 4f | 56 45 41 2e 4c 09 41 30 |cro...MO|VEA.L.A0|
|00002800| 2c 54 72 61 70 41 64 72 | 73 52 65 67 09 09 3b 20 |,TrapAdr|sReg..; |
|00002810| 73 61 76 65 20 74 68 65 | 20 74 72 61 70 20 61 64 |save the| trap ad|
|00002820| 64 72 65 73 73 0d 09 09 | 4d 4f 56 45 2e 57 09 23 |dress...|MOVE.W.#|
|00002830| 55 6e 69 6d 70 6c 65 6d | 65 6e 74 65 64 2c 44 30 |Unimplem|ented,D0|
|00002840| 09 3b 20 67 65 74 20 61 | 64 64 72 65 73 73 20 6f |.; get a|ddress o|
|00002850| 66 20 55 6e 69 6d 70 6c | 65 6d 65 6e 74 65 64 20 |f Unimpl|emented |
|00002860| 74 72 61 70 0d 09 09 5f | 47 65 74 54 72 61 70 41 |trap..._|GetTrapA|
|00002870| 64 64 72 65 73 73 0d 09 | 09 43 4d 50 41 2e 4c 09 |ddress..|.CMPA.L.|
|00002880| 41 30 2c 54 72 61 70 41 | 64 72 73 52 65 67 09 09 |A0,TrapA|drsReg..|
|00002890| 3b 20 73 65 65 20 69 66 | 20 57 61 69 74 4e 65 78 |; see if| WaitNex|
|000028a0| 74 45 76 65 6e 74 20 69 | 73 20 69 6d 70 6c 65 6d |tEvent i|s implem|
|000028b0| 65 6e 74 65 64 0d 09 09 | 42 45 51 2e 53 09 40 31 |ented...|BEQ.S.@1|
|000028c0| 09 09 09 3b 20 6e 6f 70 | 65 2c 20 74 68 65 79 27 |...; nop|e, they'|
|000028d0| 72 65 20 74 68 65 20 73 | 61 6d 65 0d 09 09 4d 4f |re the s|ame...MO|
|000028e0| 56 45 2e 57 09 23 54 72 | 75 65 2c 47 2e 48 61 73 |VE.W.#Tr|ue,G.Has|
|000028f0| 57 4e 45 76 65 6e 74 09 | 3b 20 79 65 73 2c 20 77 |WNEvent.|; yes, w|
|00002900| 65 27 76 65 20 67 6f 74 | 20 74 68 65 20 74 72 61 |e've got| the tra|
|00002910| 70 0d 09 09 09 0d 2a 20 | 2d 2d 2d 2d 2d 2d 2d 2d |p.....* |--------|
|00002920| 2d 2d 2d 2d 2d 20 49 4e | 49 54 49 41 4c 49 5a 45 |----- IN|ITIALIZE|
|00002930| 20 4d 41 4e 41 47 45 52 | 53 20 2d 2d 2d 2d 2d 2d | MANAGER|S ------|
|00002940| 2d 2d 2d 2d 2d 2d 2d 0d | 0d 40 31 09 09 50 45 41 |-------.|.@1..PEA|
|00002950| 20 09 51 44 2e 47 72 61 | 66 50 6f 72 74 20 09 09 | .QD.Gra|fPort ..|
|00002960| 3b 20 69 6e 69 74 69 61 | 6c 69 7a 65 20 61 6c 6c |; initia|lize all|
|00002970| 20 6f 66 20 74 68 65 20 | 4d 61 6e 61 67 65 72 73 | of the |Managers|
|00002980| 0d 09 09 5f 49 6e 69 74 | 47 72 61 66 09 09 09 3b |..._Init|Graf...;|
|00002990| 20 70 6c 65 61 73 65 20 | 64 6f 6e 27 74 20 66 6c | please |don't fl|
|000029a0| 75 73 68 20 6d 79 20 65 | 76 65 6e 74 73 0d 09 09 |ush my e|vents...|
|000029b0| 5f 49 6e 69 74 46 6f 6e | 74 73 0d 09 09 5f 49 6e |_InitFon|ts..._In|
|000029c0| 69 74 57 69 6e 64 6f 77 | 73 0d 09 09 5f 49 6e 69 |itWindow|s..._Ini|
|000029d0| 74 4d 65 6e 75 73 0d 09 | 09 5f 54 45 49 6e 69 74 |tMenus..|._TEInit|
|000029e0| 0d 09 09 43 4c 52 2e 4c | 09 2d 28 53 50 29 09 0d |...CLR.L|.-(SP)..|
|000029f0| 09 09 5f 49 6e 69 74 44 | 69 61 6c 6f 67 73 0d 09 |.._InitD|ialogs..|
|00002a00| 09 5f 49 6e 69 74 43 75 | 72 73 6f 72 0d 09 09 0d |._InitCu|rsor....|
|00002a10| 2a 20 43 61 6c 6c 20 4d | 50 50 4f 70 65 6e 20 61 |* Call M|PPOpen a|
|00002a20| 6e 64 20 41 54 50 4c 6f | 61 64 20 61 74 20 74 68 |nd ATPLo|ad at th|
|00002a30| 69 73 20 70 6f 69 6e 74 | 20 74 6f 20 69 6e 69 74 |is point| to init|
|00002a40| 69 61 6c 69 7a 65 20 41 | 70 70 6c 65 54 61 6c 6b |ialize A|ppleTalk|
|00002a50| 2c 20 69 66 20 79 6f 75 | 20 61 72 65 20 75 73 69 |, if you| are usi|
|00002a60| 6e 67 20 69 74 2e 0d 2a | 20 4e 4f 54 45 20 2d 2d |ng it..*| NOTE --|
|00002a70| 20 49 74 20 69 73 20 6e | 6f 20 6c 6f 6e 67 65 72 | It is n|o longer|
|00002a80| 20 6e 65 63 65 73 73 61 | 72 79 2c 20 61 6e 64 20 | necessa|ry, and |
|00002a90| 61 63 74 75 61 6c 6c 79 | 20 75 6e 68 65 61 6c 74 |actually| unhealt|
|00002aa0| 68 79 2c 20 74 6f 20 63 | 68 65 63 6b 20 50 6f 72 |hy, to c|heck Por|
|00002ab0| 74 42 55 73 65 20 61 6e | 64 0d 2a 20 53 50 43 6f |tBUse an|d.* SPCo|
|00002ac0| 6e 66 69 67 20 62 65 66 | 6f 72 65 20 6f 70 65 6e |nfig bef|ore open|
|00002ad0| 69 6e 67 20 41 70 70 6c | 65 54 61 6c 6b 2e 20 54 |ing Appl|eTalk. T|
|00002ae0| 68 65 20 64 72 69 76 65 | 72 73 20 61 72 65 20 63 |he drive|rs are c|
|00002af0| 61 70 61 62 6c 65 20 6f | 66 20 63 68 65 63 6b 69 |apable o|f checki|
|00002b00| 6e 67 20 66 6f 72 20 70 | 6f 72 74 0d 2a 20 61 76 |ng for p|ort.* av|
|00002b10| 61 69 6c 61 62 69 6c 69 | 74 79 20 74 68 65 6d 73 |ailabili|ty thems|
|00002b20| 65 6c 76 65 73 2e 20 20 | 54 68 69 73 20 6e 65 78 |elves. |This nex|
|00002b30| 74 20 62 69 74 20 6f 66 | 20 63 6f 64 65 20 69 73 |t bit of| code is|
|00002b40| 20 6e 65 63 65 73 73 61 | 72 79 20 74 6f 20 61 6c | necessa|ry to al|
|00002b50| 6c 6f 77 20 74 68 65 20 | 64 65 66 61 75 6c 74 0d |low the |default.|
|00002b60| 2a 20 62 75 74 74 6f 6e | 20 6f 66 20 6f 75 72 20 |* button| of our |
|00002b70| 61 6c 65 72 74 20 62 65 | 20 6f 75 74 6c 69 6e 65 |alert be| outline|
|00002b80| 64 2e 0d 09 20 0d 2a 20 | 2d 2d 2d 2d 2d 2d 2d 2d |d... .* |--------|
|00002b90| 2d 2d 2d 2d 2d 20 57 41 | 53 54 45 20 54 48 52 45 |----- WA|STE THRE|
|00002ba0| 45 20 45 56 45 4e 54 53 | 20 2d 2d 2d 2d 2d 2d 2d |E EVENTS| -------|
|00002bb0| 2d 2d 2d 2d 2d 2d 0d 09 | 09 4d 4f 56 45 2e 57 09 |------..|.MOVE.W.|
|00002bc0| 23 32 2c 43 6f 75 6e 74 | 52 65 67 09 09 3b 20 73 |#2,Count|Reg..; s|
|00002bd0| 65 74 20 72 65 67 69 73 | 74 65 72 20 76 61 6c 75 |et regis|ter valu|
|00002be0| 65 20 74 6f 20 6c 6f 6f | 70 20 33 20 74 69 6d 65 |e to loo|p 3 time|
|00002bf0| 73 0d 4c 6f 6f 70 09 09 | 43 4c 52 2e 57 09 2d 28 |s.Loop..|CLR.W.-(|
|00002c00| 53 50 29 09 09 09 3b 20 | 73 70 61 63 65 20 66 6f |SP)...; |space fo|
|00002c10| 72 20 72 65 73 75 6c 74 | 0d 09 09 4d 4f 56 45 2e |r result|...MOVE.|
|00002c20| 57 09 23 45 76 65 72 79 | 45 76 65 6e 74 2c 2d 28 |W.#Every|Event,-(|
|00002c30| 53 50 29 09 3b 20 74 68 | 65 20 65 76 65 6e 74 73 |SP).; th|e events|
|00002c40| 20 77 65 20 77 61 6e 74 | 0d 09 09 50 45 41 09 54 | we want|...PEA.T|
|00002c50| 68 65 45 76 65 6e 74 28 | 41 36 29 09 09 3b 20 70 |heEvent(|A6)..; p|
|00002c60| 61 73 73 20 61 20 70 6f | 69 6e 74 65 72 20 74 6f |ass a po|inter to|
|00002c70| 20 6f 75 72 20 65 76 65 | 6e 74 0d 09 09 5f 47 65 | our eve|nt..._Ge|
|00002c80| 74 4e 65 78 74 45 76 65 | 6e 74 0d 09 09 4d 4f 56 |tNextEve|nt...MOV|
|00002c90| 45 2e 57 09 28 53 50 29 | 2b 2c 44 30 09 09 3b 20 |E.W.(SP)|+,D0..; |
|00002ca0| 72 65 73 75 6c 74 20 63 | 6f 64 65 0d 09 09 44 42 |result c|ode...DB|
|00002cb0| 46 09 43 6f 75 6e 74 52 | 65 67 2c 4c 6f 6f 70 09 |F.CountR|eg,Loop.|
|00002cc0| 09 3b 20 64 65 63 72 65 | 6d 65 6e 74 20 63 6f 75 |.; decre|ment cou|
|00002cd0| 6e 74 2c 20 69 66 20 63 | 6f 75 6e 74 20 3c 20 30 |nt, if c|ount < 0|
|00002ce0| 20 74 68 65 6e 20 63 6f | 6e 74 69 6e 75 65 0d 0d | then co|ntinue..|
|00002cf0| 2a 20 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 20 |* ------|------- |
|00002d00| 47 45 54 20 54 48 45 20 | 45 4e 56 49 52 4f 4e 4d |GET THE |ENVIRONM|
|00002d10| 45 4e 54 20 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |ENT ----|--------|
|00002d20| 2d 0d 0d 09 09 43 4c 52 | 2e 57 09 2d 28 53 50 29 |-....CLR|.W.-(SP)|
|00002d30| 09 09 09 3b 20 63 72 65 | 61 74 65 20 73 70 61 63 |...; cre|ate spac|
|00002d40| 65 20 66 6f 72 20 72 65 | 73 75 6c 74 0d 09 09 4d |e for re|sult...M|
|00002d50| 4f 56 45 2e 57 09 23 45 | 6e 76 69 72 6f 6e 73 56 |OVE.W.#E|nvironsV|
|00002d60| 65 72 73 69 6f 6e 2c 2d | 28 53 50 29 09 3b 20 76 |ersion,-|(SP).; v|
|00002d70| 65 72 73 69 6f 6e 20 6f | 66 20 53 79 73 45 6e 76 |ersion o|f SysEnv|
|00002d80| 69 72 6f 6e 73 20 77 65 | 20 77 61 6e 74 0d 09 09 |irons we| want...|
|00002d90| 50 45 41 09 47 2e 4d 61 | 63 09 09 09 3b 20 74 68 |PEA.G.Ma|c...; th|
|00002da0| 65 20 67 6c 6f 62 61 6c | 20 65 6e 76 69 72 6f 6e |e global| environ|
|00002db0| 6d 65 6e 74 20 72 65 63 | 6f 72 64 0d 09 09 4a 53 |ment rec|ord...JS|
|00002dc0| 52 09 53 79 73 45 6e 76 | 69 72 6f 6e 73 09 09 3b |R.SysEnv|irons..;|
|00002dd0| 20 77 65 20 63 61 6e 20 | 69 67 6e 6f 72 65 20 61 | we can |ignore a|
|00002de0| 6e 79 20 65 72 72 6f 72 | 73 20 68 65 72 65 2c 0d |ny error|s here,.|
|00002df0| 09 09 4d 4f 56 45 2e 57 | 09 28 53 50 29 2b 2c 44 |..MOVE.W|.(SP)+,D|
|00002e00| 30 09 09 3b 20 53 79 73 | 45 6e 76 69 72 6f 6e 73 |0..; Sys|Environs|
|00002e10| 20 77 69 6c 6c 20 66 69 | 6c 6c 20 69 6e 20 72 65 | will fi|ll in re|
|00002e20| 67 61 72 64 6c 65 73 73 | 0d 09 09 4d 4f 56 45 2e |gardless|...MOVE.|
|00002e30| 57 09 47 2e 4d 61 63 2e | 4d 61 63 68 69 6e 65 54 |W.G.Mac.|MachineT|
|00002e40| 79 70 65 2c 44 30 20 09 | 3b 20 6e 65 67 69 74 69 |ype,D0 .|; negiti|
|00002e50| 76 65 20 76 61 6c 75 65 | 20 6d 65 61 6e 73 20 6f |ve value| means o|
|00002e60| 6c 64 20 52 4f 4d 73 0d | 09 09 42 50 4c 2e 53 09 |ld ROMs.|..BPL.S.|
|00002e70| 40 32 09 09 09 3b 20 31 | 32 38 6b 20 52 4f 4d 73 |@2...; 1|28k ROMs|
|00002e80| 20 6f 72 20 62 65 74 74 | 65 72 2c 20 63 6f 6e 74 | or bett|er, cont|
|00002e90| 69 6e 75 65 20 6f 6e 0d | 09 09 4a 4d 50 09 41 6c |inue on.|..JMP.Al|
|00002ea0| 65 72 74 55 73 65 72 09 | 09 3b 20 77 65 20 64 6f |ertUser.|.; we do|
|00002eb0| 6e 27 74 20 77 61 6e 74 | 20 74 6f 20 72 75 6e 20 |n't want| to run |
|00002ec0| 6f 6e 20 36 34 6b 20 52 | 4f 4d 73 0d 0d 2a 20 2d |on 64k R|OMs..* -|
|00002ed0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 20 43 48 45 |--------|---- CHE|
|00002ee0| 43 4b 20 46 4f 52 20 45 | 4e 4f 55 47 48 20 4d 45 |CK FOR E|NOUGH ME|
|00002ef0| 4d 4f 52 59 20 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |MORY ---|--------|
|00002f00| 2d 2d 0d 2a 20 49 74 20 | 69 73 20 62 65 74 74 65 |--.* It |is bette|
|00002f10| 72 20 74 6f 20 66 69 72 | 73 74 20 63 68 65 63 6b |r to fir|st check|
|00002f20| 20 74 68 65 20 73 69 7a | 65 20 6f 66 20 74 68 65 | the siz|e of the|
|00002f30| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 68 65 61 | applica|tion hea|
|00002f40| 70 20 61 67 61 69 6e 73 | 74 20 61 20 76 61 6c 75 |p agains|t a valu|
|00002f50| 65 0d 2a 20 74 68 61 74 | 20 79 6f 75 20 68 61 76 |e.* that| you hav|
|00002f60| 65 20 64 65 74 65 72 6d | 69 6e 65 64 20 69 73 20 |e determ|ined is |
|00002f70| 74 68 65 20 73 6d 61 6c | 6c 65 73 74 20 68 65 61 |the smal|lest hea|
|00002f80| 70 20 74 68 65 20 61 70 | 70 6c 69 63 61 74 69 6f |p the ap|plicatio|
|00002f90| 6e 20 63 61 6e 20 72 65 | 61 73 6f 6e 61 62 6c 79 |n can re|asonably|
|00002fa0| 0d 2a 20 77 6f 72 6b 20 | 69 6e 2e 20 54 68 69 73 |.* work |in. This|
|00002fb0| 20 6e 75 6d 62 65 72 20 | 73 68 6f 75 6c 64 20 62 | number |should b|
|00002fc0| 65 20 64 65 72 69 76 65 | 64 20 62 79 20 65 78 61 |e derive|d by exa|
|00002fd0| 6d 69 6e 69 6e 67 20 74 | 68 65 20 73 69 7a 65 20 |mining t|he size |
|00002fe0| 6f 66 20 74 68 65 20 68 | 65 61 70 20 74 68 61 74 |of the h|eap that|
|00002ff0| 0d 2a 20 69 73 20 61 63 | 74 75 61 6c 6c 79 20 70 |.* is ac|tually p|
|00003000| 72 6f 76 69 64 65 64 20 | 62 79 20 4d 75 6c 74 69 |rovided |by Multi|
|00003010| 46 69 6e 64 65 72 20 77 | 68 65 6e 20 74 68 65 20 |Finder w|hen the |
|00003020| 6d 69 6e 69 6d 75 6d 20 | 73 69 7a 65 20 72 65 71 |minimum |size req|
|00003030| 75 65 73 74 65 64 20 69 | 73 20 75 73 65 64 2e 0d |uested i|s used..|
|00003040| 2a 20 54 68 65 20 64 65 | 72 69 76 61 74 69 6f 6e |* The de|rivation|
|00003050| 20 6f 66 20 74 68 65 20 | 6d 69 6e 69 6d 75 6d 20 | of the |minimum |
|00003060| 73 69 7a 65 20 72 65 71 | 75 65 73 74 65 64 20 66 |size req|uested f|
|00003070| 72 6f 6d 20 4d 75 6c 74 | 69 46 69 6e 64 65 72 20 |rom Mult|iFinder |
|00003080| 69 73 20 64 65 73 63 72 | 69 62 65 64 0d 2a 20 69 |is descr|ibed.* i|
|00003090| 6e 20 41 53 61 6d 70 6c | 65 2e 72 2e 20 54 68 65 |n ASampl|e.r. The|
|000030a0| 20 63 68 65 63 6b 20 73 | 68 6f 75 6c 64 20 62 65 | check s|hould be|
|000030b0| 20 6d 61 64 65 20 62 65 | 63 61 75 73 65 20 74 68 | made be|cause th|
|000030c0| 65 20 70 72 65 66 65 72 | 72 65 64 20 73 69 7a 65 |e prefer|red size|
|000030d0| 20 63 61 6e 20 65 6e 64 | 20 75 70 0d 2a 20 62 65 | can end| up.* be|
|000030e0| 69 6e 67 20 73 65 74 20 | 73 6d 61 6c 6c 65 72 20 |ing set |smaller |
|000030f0| 74 68 61 6e 20 74 68 65 | 20 6d 69 6e 69 6d 75 6d |than the| minimum|
|00003100| 20 73 69 7a 65 20 62 79 | 20 74 68 65 20 75 73 65 | size by| the use|
|00003110| 72 2e 20 54 68 69 73 20 | 65 78 74 72 61 20 63 68 |r. This |extra ch|
|00003120| 65 63 6b 20 61 63 74 73 | 20 74 6f 0d 2a 20 69 6e |eck acts| to.* in|
|00003130| 73 75 72 65 20 74 68 61 | 74 20 79 6f 75 72 20 61 |sure tha|t your a|
|00003140| 70 70 6c 69 63 61 74 69 | 6f 6e 20 69 73 20 73 74 |pplicati|on is st|
|00003150| 61 72 74 69 6e 67 20 66 | 72 6f 6d 20 61 20 73 6f |arting f|rom a so|
|00003160| 6c 69 64 20 6d 65 6d 6f | 72 79 20 66 6f 75 6e 64 |lid memo|ry found|
|00003170| 61 74 69 6f 6e 2e 0d 20 | 0d 2a 20 20 20 20 49 46 |ation.. |.* IF|
|00003180| 20 61 70 70 6c 4c 69 6d | 69 74 20 2d 20 61 70 70 | applLim|it - app|
|00003190| 6c 5a 6f 6e 65 20 3c 20 | 4d 69 6e 48 65 61 70 20 |lZone < |MinHeap |
|000031a0| 54 48 45 4e 20 41 6c 65 | 72 74 55 73 65 72 0d 0d |THEN Ale|rtUser..|
|000031b0| 2a 20 4e 65 78 74 2c 20 | 6d 61 6b 65 20 73 75 72 |* Next, |make sur|
|000031c0| 65 20 74 68 61 74 20 65 | 6e 6f 75 67 68 20 6d 65 |e that e|nough me|
|000031d0| 6d 6f 72 79 20 69 73 20 | 66 72 65 65 20 66 6f 72 |mory is |free for|
|000031e0| 20 79 6f 75 72 20 61 70 | 70 6c 69 63 61 74 69 6f | your ap|plicatio|
|000031f0| 6e 20 74 6f 20 72 75 6e | 2e 20 49 74 0d 2a 20 69 |n to run|. It.* i|
|00003200| 73 20 70 6f 73 73 69 62 | 6c 65 20 66 6f 72 20 61 |s possib|le for a|
|00003210| 20 73 69 74 75 61 74 69 | 6f 6e 20 74 6f 20 61 72 | situati|on to ar|
|00003220| 69 73 65 20 77 68 65 72 | 65 20 74 68 65 20 68 65 |ise wher|e the he|
|00003230| 61 70 20 6d 61 79 20 68 | 61 76 65 20 62 65 65 6e |ap may h|ave been|
|00003240| 20 6f 66 20 72 65 71 75 | 69 72 65 64 0d 2a 20 73 | of requ|ired.* s|
|00003250| 69 7a 65 2c 20 62 75 74 | 20 61 20 6c 61 72 67 65 |ize, but| a large|
|00003260| 20 73 63 72 61 70 20 77 | 61 73 20 6c 6f 61 64 65 | scrap w|as loade|
|00003270| 64 20 77 68 69 63 68 20 | 6c 65 66 74 20 74 6f 6f |d which |left too|
|00003280| 20 6c 69 74 74 6c 65 20 | 6d 65 6d 6f 72 79 2e 20 | little |memory. |
|00003290| 54 6f 20 63 68 65 63 6b | 20 66 6f 72 0d 2a 20 74 |To check| for.* t|
|000032a0| 68 69 73 2c 20 63 61 6c | 6c 20 50 75 72 67 65 53 |his, cal|l PurgeS|
|000032b0| 70 61 63 65 20 61 6e 64 | 20 63 6f 6d 70 61 72 65 |pace and| compare|
|000032c0| 20 74 68 65 20 72 65 73 | 75 6c 74 20 77 69 74 68 | the res|ult with|
|000032d0| 20 61 20 76 61 6c 75 65 | 20 74 68 61 74 20 79 6f | a value| that yo|
|000032e0| 75 20 68 61 76 65 20 64 | 65 74 65 72 6d 69 6e 65 |u have d|etermine|
|000032f0| 64 0d 2a 20 69 73 20 74 | 68 65 20 6d 69 6e 69 6d |d.* is t|he minim|
|00003300| 75 6d 20 61 6d 6f 75 6e | 74 20 6f 66 20 66 72 65 |um amoun|t of fre|
|00003310| 65 20 6d 65 6d 6f 72 79 | 20 79 6f 75 72 20 61 70 |e memory| your ap|
|00003320| 70 6c 69 63 61 74 69 6f | 6e 20 6e 65 65 64 73 20 |plicatio|n needs |
|00003330| 61 74 20 69 6e 69 74 69 | 61 6c 69 7a 61 74 69 6f |at initi|alizatio|
|00003340| 6e 2e 0d 2a 20 54 68 69 | 73 20 6e 75 6d 62 65 72 |n..* Thi|s number|
|00003350| 20 63 61 6e 20 62 65 20 | 64 65 72 69 76 65 64 20 | can be |derived |
|00003360| 73 65 76 65 72 61 6c 20 | 64 69 66 66 65 72 65 6e |several |differen|
|00003370| 74 20 77 61 79 73 2e 20 | 4f 6e 65 20 77 61 79 20 |t ways. |One way |
|00003380| 74 68 61 74 20 69 73 20 | 66 61 69 72 6c 79 0d 2a |that is |fairly.*|
|00003390| 20 73 74 72 61 69 67 68 | 74 66 6f 72 77 61 72 64 | straigh|tforward|
|000033a0| 20 69 73 20 74 6f 20 72 | 75 6e 20 74 68 65 20 61 | is to r|un the a|
|000033b0| 70 70 6c 69 63 61 74 69 | 6f 6e 20 69 6e 20 74 68 |pplicati|on in th|
|000033c0| 65 20 6d 69 6e 69 6d 75 | 6d 20 73 69 7a 65 20 63 |e minimu|m size c|
|000033d0| 6f 6e 66 69 67 75 72 61 | 74 69 6f 6e 0d 2a 20 61 |onfigura|tion.* a|
|000033e0| 73 20 64 65 73 63 72 69 | 62 65 64 20 70 72 65 76 |s descri|bed prev|
|000033f0| 69 6f 75 73 6c 79 2e 20 | 43 61 6c 6c 20 50 75 72 |iously. |Call Pur|
|00003400| 67 65 53 70 61 63 65 20 | 61 74 20 69 6e 69 74 69 |geSpace |at initi|
|00003410| 61 6c 69 7a 61 74 69 6f | 6e 20 61 6e 64 20 65 78 |alizatio|n and ex|
|00003420| 61 6d 69 6e 65 20 74 68 | 65 20 76 61 6c 75 65 0d |amine th|e value.|
|00003430| 2a 20 72 65 74 75 72 6e | 65 64 2e 20 48 6f 77 65 |* return|ed. Howe|
|00003440| 76 65 72 2c 20 79 6f 75 | 20 73 68 6f 75 6c 64 20 |ver, you| should |
|00003450| 6d 61 6b 65 20 73 75 72 | 65 20 74 68 61 74 20 74 |make sur|e that t|
|00003460| 68 69 73 20 72 65 73 75 | 6c 74 20 69 73 20 6e 6f |his resu|lt is no|
|00003470| 74 20 62 65 69 6e 67 20 | 6d 6f 64 69 66 69 65 64 |t being |modified|
|00003480| 0d 2a 20 62 79 20 74 68 | 65 20 73 63 72 61 70 27 |.* by th|e scrap'|
|00003490| 73 20 70 72 65 73 65 6e | 63 65 2e 20 59 6f 75 20 |s presen|ce. You |
|000034a0| 63 61 6e 20 64 6f 20 74 | 68 61 74 20 62 79 20 63 |can do t|hat by c|
|000034b0| 61 6c 6c 69 6e 67 20 5a | 65 72 6f 53 63 72 61 70 |alling Z|eroScrap|
|000034c0| 20 62 65 66 6f 72 65 20 | 63 61 6c 6c 69 6e 67 0d | before |calling.|
|000034d0| 2a 20 50 75 72 67 65 53 | 70 61 63 65 2e 20 4d 61 |* PurgeS|pace. Ma|
|000034e0| 6b 65 20 73 75 72 65 20 | 74 6f 20 72 65 6d 6f 76 |ke sure |to remov|
|000034f0| 65 20 74 68 61 74 20 63 | 61 6c 6c 20 62 65 66 6f |e that c|all befo|
|00003500| 72 65 20 73 68 69 70 70 | 69 6e 67 2c 20 74 68 6f |re shipp|ing, tho|
|00003510| 75 67 68 2e 0d 20 0d 2a | 20 54 68 65 20 65 78 74 |ugh.. .*| The ext|
|00003520| 72 61 20 62 65 6e 65 66 | 69 74 20 74 6f 20 77 61 |ra benef|it to wa|
|00003530| 69 74 69 6e 67 20 75 6e | 74 69 6c 20 61 66 74 65 |iting un|til afte|
|00003540| 72 20 74 68 65 20 54 6f | 6f 6c 62 6f 78 20 4d 61 |r the To|olbox Ma|
|00003550| 6e 61 67 65 72 73 20 68 | 61 76 65 20 62 65 65 6e |nagers h|ave been|
|00003560| 20 69 6e 69 74 69 61 6c | 69 7a 65 64 0d 2a 20 62 | initial|ized.* b|
|00003570| 65 66 6f 72 65 20 63 68 | 65 63 6b 69 6e 67 20 6d |efore ch|ecking m|
|00003580| 65 6d 6f 72 79 20 69 73 | 20 74 68 61 74 20 77 65 |emory is| that we|
|00003590| 20 63 61 6e 20 6e 6f 77 | 20 67 69 76 65 20 74 68 | can now| give th|
|000035a0| 65 20 75 73 65 72 20 61 | 6e 20 61 6c 65 72 74 20 |e user a|n alert |
|000035b0| 74 6f 20 74 65 6c 6c 20 | 68 69 6d 20 77 68 61 74 |to tell |him what|
|000035c0| 0d 2a 20 68 61 70 70 65 | 6e 65 64 2e 20 41 6c 74 |.* happe|ned. Alt|
|000035d0| 68 6f 75 67 68 20 69 74 | 20 69 73 20 70 6f 73 73 |hough it| is poss|
|000035e0| 69 62 6c 65 20 74 68 61 | 74 20 74 68 65 20 6d 65 |ible tha|t the me|
|000035f0| 6d 6f 72 79 20 73 69 74 | 75 61 74 69 6f 6e 20 63 |mory sit|uation c|
|00003600| 6f 75 6c 64 20 62 65 20 | 77 6f 72 73 65 6e 65 64 |ould be |worsened|
|00003610| 20 62 79 0d 2a 20 64 69 | 73 70 6c 61 79 69 6e 67 | by.* di|splaying|
|00003620| 20 61 6e 20 61 6c 65 72 | 74 2c 20 4d 75 6c 74 69 | an aler|t, Multi|
|00003630| 46 69 6e 64 65 72 20 77 | 6f 75 6c 64 20 67 72 61 |Finder w|ould gra|
|00003640| 63 65 66 75 6c 6c 79 20 | 65 78 69 74 20 74 68 65 |cefully |exit the|
|00003650| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 77 69 74 | applica|tion wit|
|00003660| 68 0d 2a 20 61 6e 20 69 | 6e 66 6f 72 6d 61 74 69 |h.* an i|nformati|
|00003670| 76 65 20 61 6c 65 72 74 | 20 69 66 20 6d 65 6d 6f |ve alert| if memo|
|00003680| 72 79 20 62 65 63 61 6d | 65 20 63 72 69 74 69 63 |ry becam|e critic|
|00003690| 61 6c 2e 20 48 65 72 65 | 20 77 65 20 61 72 65 20 |al. Here| we are |
|000036a0| 61 63 74 69 6e 67 20 6d | 6f 72 65 0d 2a 20 69 6e |acting m|ore.* in|
|000036b0| 20 61 20 70 72 65 76 65 | 6e 74 61 74 69 76 65 20 | a preve|ntative |
|000036c0| 6d 61 6e 6e 65 72 20 74 | 6f 20 61 76 6f 69 64 20 |manner t|o avoid |
|000036d0| 66 75 74 75 72 65 20 64 | 69 73 61 73 74 65 72 20 |future d|isaster |
|000036e0| 66 72 6f 6d 20 6c 6f 77 | 2d 6d 65 6d 6f 72 79 20 |from low|-memory |
|000036f0| 70 72 6f 62 6c 65 6d 73 | 2e 0d 20 0d 40 32 09 09 |problems|.. .@2..|
|00003700| 4d 4f 56 45 2e 4c 09 61 | 70 70 6c 4c 69 6d 69 74 |MOVE.L.a|pplLimit|
|00003710| 2c 44 31 09 09 3b 20 67 | 65 74 20 70 6f 69 6e 74 |,D1..; g|et point|
|00003720| 65 72 20 74 6f 20 41 70 | 70 6c 4c 69 6d 69 74 0d |er to Ap|plLimit.|
|00003730| 09 09 4d 4f 56 45 2e 4c | 09 61 70 70 6c 5a 6f 6e |..MOVE.L|.applZon|
|00003740| 65 2c 44 30 09 09 3b 20 | 67 65 74 20 70 6f 69 6e |e,D0..; |get poin|
|00003750| 74 65 72 20 74 6f 20 41 | 70 70 6c 69 63 5a 6f 6e |ter to A|pplicZon|
|00003760| 65 0d 09 09 53 55 42 2e | 4c 09 44 30 2c 44 31 09 |e...SUB.|L.D0,D1.|
|00003770| 09 09 3b 20 73 75 62 74 | 72 61 63 74 20 74 68 65 |..; subt|ract the|
|00003780| 20 41 70 70 6c 69 63 5a | 6f 6e 65 20 66 72 6f 6d | ApplicZ|one from|
|00003790| 20 41 70 70 6c 4c 69 6d | 69 74 0d 09 09 43 4d 50 | ApplLim|it...CMP|
|000037a0| 49 2e 4c 09 23 4d 69 6e | 48 65 61 70 2c 44 31 09 |I.L.#Min|Heap,D1.|
|000037b0| 09 3b 20 64 6f 20 77 65 | 20 68 61 76 65 20 65 6e |.; do we| have en|
|000037c0| 6f 75 67 68 20 6d 65 6d | 6f 72 79 3f 0d 09 09 42 |ough mem|ory?...B|
|000037d0| 50 4c 2e 53 09 40 33 09 | 09 09 3b 20 79 65 73 20 |PL.S.@3.|..; yes |
|000037e0| 77 65 20 64 6f 2c 20 63 | 6f 6e 74 69 6e 75 65 20 |we do, c|ontinue |
|000037f0| 6f 6e 0d 09 09 4a 4d 50 | 09 41 6c 65 72 74 55 73 |on...JMP|.AlertUs|
|00003800| 65 72 09 09 3b 20 6e 6f | 2c 20 72 65 70 6f 72 74 |er..; no|, report|
|00003810| 20 74 68 65 20 65 72 72 | 6f 72 0d 09 09 0d 40 33 | the err|or....@3|
|00003820| 09 09 5f 50 75 72 67 65 | 53 70 61 63 65 09 09 09 |.._Purge|Space...|
|00003830| 3b 20 72 65 73 75 6c 74 | 73 20 77 69 6c 6c 20 62 |; result|s will b|
|00003840| 65 20 69 6e 20 41 30 20 | 61 6e 64 20 44 30 0d 09 |e in A0 |and D0..|
|00003850| 09 43 4d 50 49 2e 4c 09 | 23 4d 69 6e 53 70 61 63 |.CMPI.L.|#MinSpac|
|00003860| 65 2c 44 30 09 09 3b 20 | 64 6f 20 77 65 20 68 61 |e,D0..; |do we ha|
|00003870| 76 65 20 65 6e 6f 75 67 | 68 20 70 75 72 67 65 61 |ve enoug|h purgea|
|00003880| 62 6c 65 20 73 70 61 63 | 65 3f 0d 09 09 42 50 4c |ble spac|e?...BPL|
|00003890| 2e 53 09 40 34 0d 09 09 | 4a 4d 50 09 41 6c 65 72 |.S.@4...|JMP.Aler|
|000038a0| 74 55 73 65 72 09 09 3b | 20 6e 6f 2c 20 72 65 70 |tUser..;| no, rep|
|000038b0| 6f 72 74 20 74 68 65 20 | 65 72 72 6f 72 0d 0d 2a |ort the |error..*|
|000038c0| 20 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 20 53 | -------|------ S|
|000038d0| 45 54 20 55 50 20 54 48 | 45 20 54 52 41 46 46 49 |ET UP TH|E TRAFFI|
|000038e0| 43 20 4c 49 47 48 54 20 | 57 49 4e 44 4f 57 20 2d |C LIGHT |WINDOW -|
|000038f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 0d 2a 20 57 |--------|----.* W|
|00003900| 65 20 77 69 6c 6c 20 61 | 6c 6c 6f 63 61 74 65 20 |e will a|llocate |
|00003910| 6f 75 72 20 6f 77 6e 20 | 77 69 6e 64 6f 77 20 73 |our own |window s|
|00003920| 74 6f 72 61 67 65 20 69 | 6e 73 74 65 61 64 20 6f |torage i|nstead o|
|00003930| 66 20 6c 65 74 74 69 6e | 67 20 74 68 65 20 57 69 |f lettin|g the Wi|
|00003940| 6e 64 6f 77 20 4d 61 6e | 61 67 65 72 0d 2a 20 66 |ndow Man|ager.* f|
|00003950| 6f 72 20 74 77 6f 20 72 | 65 61 73 6f 6e 73 2e 20 |or two r|easons. |
|00003960| 4f 6e 65 2c 20 47 65 74 | 4e 65 77 57 69 6e 64 6f |One, Get|NewWindo|
|00003970| 77 20 6c 6f 63 6b 73 20 | 74 68 65 20 27 57 49 4e |w locks |the 'WIN|
|00003980| 44 27 20 72 65 73 6f 75 | 72 63 65 20 68 61 6e 64 |D' resou|rce hand|
|00003990| 6c 65 20 62 65 66 6f 72 | 65 20 63 61 6c 6c 69 6e |le befor|e callin|
|000039a0| 67 0d 2a 20 4e 65 77 57 | 69 6e 64 6f 77 20 61 6e |g.* NewW|indow an|
|000039b0| 64 20 74 68 69 73 20 63 | 61 6e 20 6c 65 61 64 20 |d this c|an lead |
|000039c0| 74 6f 20 68 65 61 70 20 | 66 72 61 67 6d 65 6e 74 |to heap |fragment|
|000039d0| 61 74 69 6f 6e 2e 20 20 | 54 77 6f 2c 20 69 74 20 |ation. |Two, it |
|000039e0| 74 61 6b 65 73 20 6a 75 | 73 74 20 61 73 20 6d 75 |takes ju|st as mu|
|000039f0| 63 68 20 74 69 6d 65 0d | 2a 20 66 6f 72 20 4e 65 |ch time.|* for Ne|
|00003a00| 77 57 69 6e 64 6f 77 20 | 74 6f 20 67 65 74 20 74 |wWindow |to get t|
|00003a10| 68 65 20 6d 65 6d 6f 72 | 79 20 61 73 20 69 74 20 |he memor|y as it |
|00003a20| 64 6f 65 73 20 66 6f 72 | 20 75 73 20 74 6f 20 67 |does for| us to g|
|00003a30| 65 74 20 69 74 2e 0d 0d | 40 34 09 09 4d 4f 56 45 |et it...|@4..MOVE|
|00003a40| 2e 4c 09 23 77 69 6e 64 | 6f 77 53 69 7a 65 2c 44 |.L.#wind|owSize,D|
|00003a50| 30 0d 09 09 5f 4e 65 77 | 50 74 72 20 2c 43 6c 65 |0..._New|Ptr ,Cle|
|00003a60| 61 72 09 09 09 3b 20 63 | 72 65 61 74 65 20 61 20 |ar...; c|reate a |
|00003a70| 70 6f 69 6e 74 65 72 20 | 69 6e 20 41 30 20 61 6e |pointer |in A0 an|
|00003a80| 64 20 63 6c 65 61 72 20 | 6d 65 6d 6f 72 79 0d 09 |d clear |memory..|
|00003a90| 09 43 4d 50 41 2e 4c 09 | 23 4e 49 4c 2c 41 30 09 |.CMPA.L.|#NIL,A0.|
|00003aa0| 09 09 3b 20 63 68 65 63 | 6b 20 66 6f 72 20 4e 49 |..; chec|k for NI|
|00003ab0| 4c 20 70 6f 69 6e 74 65 | 72 20 28 72 65 73 75 6c |L pointe|r (resul|
|00003ac0| 74 20 69 6e 20 44 30 29 | 0d 09 09 42 4e 45 2e 53 |t in D0)|...BNE.S|
|00003ad0| 09 40 35 09 09 09 3b 20 | 6d 75 73 74 20 68 61 76 |.@5...; |must hav|
|00003ae0| 65 20 62 65 65 6e 20 61 | 20 76 61 6c 69 64 20 70 |e been a| valid p|
|00003af0| 6f 69 6e 74 65 72 0d 09 | 09 4a 4d 50 09 41 6c 65 |ointer..|.JMP.Ale|
|00003b00| 72 74 55 73 65 72 09 09 | 3b 20 63 6f 75 6c 64 6e |rtUser..|; couldn|
|00003b10| 27 74 20 67 65 74 20 6d | 65 6d 6f 72 79 2c 20 72 |'t get m|emory, r|
|00003b20| 65 70 6f 72 74 20 65 72 | 72 6f 72 0d 09 09 0d 40 |eport er|ror....@|
|00003b30| 35 09 09 43 4c 52 2e 4c | 09 2d 28 53 50 29 09 09 |5..CLR.L|.-(SP)..|
|00003b40| 09 3b 20 63 72 65 61 74 | 65 20 73 70 61 63 65 20 |.; creat|e space |
|00003b50| 66 6f 72 20 72 65 73 75 | 6c 74 0d 09 09 4d 4f 56 |for resu|lt...MOV|
|00003b60| 45 2e 57 09 23 72 57 69 | 6e 64 6f 77 2c 2d 28 53 |E.W.#rWi|ndow,-(S|
|00003b70| 50 29 09 09 3b 20 6f 75 | 74 20 77 69 6e 64 6f 77 |P)..; ou|t window|
|00003b80| 20 72 65 73 6f 75 72 63 | 65 20 64 65 66 69 6e 69 | resourc|e defini|
|00003b90| 74 69 6f 6e 0d 09 09 4d | 4f 56 45 2e 4c 09 41 30 |tion...M|OVE.L.A0|
|00003ba0| 2c 2d 28 53 50 29 09 09 | 3b 20 6f 75 72 20 77 69 |,-(SP)..|; our wi|
|00003bb0| 6e 64 6f 77 20 72 65 63 | 6f 72 64 20 73 74 6f 72 |ndow rec|ord stor|
|00003bc0| 61 67 65 0d 09 09 4d 4f | 56 45 2e 4c 09 23 2d 31 |age...MO|VE.L.#-1|
|00003bd0| 2c 2d 28 53 50 29 09 09 | 3b 20 6d 61 6b 65 20 69 |,-(SP)..|; make i|
|00003be0| 74 20 6f 6e 20 74 6f 70 | 0d 09 09 5f 47 65 74 4e |t on top|..._GetN|
|00003bf0| 65 77 57 69 6e 64 6f 77 | 09 09 09 3b 20 63 72 65 |ewWindow|...; cre|
|00003c00| 61 74 65 20 74 68 65 20 | 77 69 6e 64 6f 77 0d 09 |ate the |window..|
|00003c10| 09 4d 4f 56 45 2e 4c 09 | 28 53 50 29 2b 2c 44 30 |.MOVE.L.|(SP)+,D0|
|00003c20| 09 09 3b 20 77 65 27 72 | 65 20 6e 6f 74 20 73 61 |..; we'r|e not sa|
|00003c30| 76 69 6e 67 20 6f 75 72 | 20 77 69 6e 64 6f 77 20 |ving our| window |
|00003c40| 70 6f 69 6e 74 65 72 0d | 09 09 0d 2a 20 2d 2d 2d |pointer.|...* ---|
|00003c50| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 20 53 45 54 20 55 |--------|-- SET U|
|00003c60| 50 20 54 48 45 20 4d 45 | 4e 55 53 20 2d 2d 2d 2d |P THE ME|NUS ----|
|00003c70| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 0d 09 0d 09 09 43 4c |--------|-.....CL|
|00003c80| 52 2e 4c 09 2d 28 53 50 | 29 09 09 09 3b 20 73 70 |R.L.-(SP|)...; sp|
|00003c90| 61 63 65 20 66 6f 72 20 | 4d 65 6e 75 42 61 72 20 |ace for |MenuBar |
|00003ca0| 68 61 6e 64 6c 65 0d 09 | 09 4d 4f 56 45 2e 57 09 |handle..|.MOVE.W.|
|00003cb0| 23 72 4d 65 6e 75 42 61 | 72 2c 2d 28 53 50 29 09 |#rMenuBa|r,-(SP).|
|00003cc0| 09 3b 20 6f 75 72 20 4d | 65 6e 75 42 61 72 20 72 |.; our M|enuBar r|
|00003cd0| 65 73 6f 75 72 63 65 0d | 09 09 5f 47 65 74 4e 65 |esource.|.._GetNe|
|00003ce0| 77 4d 42 61 72 09 09 09 | 3b 20 74 68 65 20 6d 6f |wMBar...|; the mo|
|00003cf0| 64 65 72 6e 20 77 61 79 | 2c 20 67 65 74 20 61 20 |dern way|, get a |
|00003d00| 4d 65 6e 75 42 61 72 0d | 09 09 4d 4f 56 45 2e 4c |MenuBar.|..MOVE.L|
|00003d10| 09 28 53 50 29 2c 43 75 | 72 4d 42 61 72 28 41 36 |.(SP),Cu|rMBar(A6|
|00003d20| 29 0d 09 09 5f 53 65 74 | 4d 65 6e 75 42 61 72 0d |)..._Set|MenuBar.|
|00003d30| 09 09 4d 4f 56 45 41 2e | 4c 09 43 75 72 4d 42 61 |..MOVEA.|L.CurMBa|
|00003d40| 72 28 41 36 29 2c 41 30 | 09 09 3b 20 77 65 27 72 |r(A6),A0|..; we'r|
|00003d50| 65 20 64 6f 6e 65 20 77 | 69 74 68 20 74 68 61 74 |e done w|ith that|
|00003d60| 20 68 61 6e 64 6c 65 0d | 09 09 5f 44 69 73 70 6f | handle.|.._Dispo|
|00003d70| 73 48 61 6e 64 6c 65 09 | 09 09 3b 20 74 68 65 72 |sHandle.|..; ther|
|00003d80| 65 20 69 73 20 61 20 72 | 65 73 75 6c 74 20 69 6e |e is a r|esult in|
|00003d90| 20 44 30 0d 09 09 43 4c | 52 2e 4c 09 2d 28 53 50 | D0...CL|R.L.-(SP|
|00003da0| 29 0d 09 09 4d 4f 56 45 | 2e 57 09 23 41 70 70 6c |)...MOVE|.W.#Appl|
|00003db0| 65 4d 65 6e 75 2c 2d 28 | 53 50 29 0d 09 09 5f 47 |eMenu,-(|SP)..._G|
|00003dc0| 65 74 4d 48 61 6e 64 6c | 65 09 09 09 3b 20 70 75 |etMHandl|e...; pu|
|00003dd0| 74 20 41 70 70 6c 65 20 | 6d 65 6e 75 20 68 61 6e |t Apple |menu han|
|00003de0| 64 6c 65 20 6f 6e 20 73 | 74 61 63 6b 0d 09 09 4d |dle on s|tack...M|
|00003df0| 4f 56 45 2e 4c 09 23 27 | 44 52 56 52 27 2c 2d 28 |OVE.L.#'|DRVR',-(|
|00003e00| 53 50 29 09 09 3b 20 67 | 65 74 20 61 6c 6c 20 74 |SP)..; g|et all t|
|00003e10| 68 65 20 44 41 73 0d 09 | 09 5f 41 64 64 52 65 73 |he DAs..|._AddRes|
|00003e20| 4d 65 6e 75 0d 09 09 5f | 44 72 61 77 4d 65 6e 75 |Menu..._|DrawMenu|
|00003e30| 42 61 72 0d 0d 2a 20 2d | 2d 2d 2d 2d 2d 2d 2d 2d |Bar..* -|--------|
|00003e40| 2d 2d 2d 2d 20 53 45 54 | 20 55 50 20 52 45 43 54 |---- SET| UP RECT|
|00003e50| 53 20 46 4f 52 20 54 48 | 45 20 4c 49 47 48 54 53 |S FOR TH|E LIGHTS|
|00003e60| 20 20 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0d | ------|-------.|
|00003e70| 0d 09 09 43 4c 52 2e 57 | 09 2d 28 53 50 29 09 09 |...CLR.W|.-(SP)..|
|00003e80| 09 3b 20 73 70 61 63 65 | 20 66 6f 72 20 72 65 73 |.; space| for res|
|00003e90| 75 6c 74 20 6f 66 20 47 | 6f 47 65 74 52 65 63 74 |ult of G|oGetRect|
|00003ea0| 0d 09 09 4d 4f 56 45 2e | 57 09 23 72 53 74 6f 70 |...MOVE.|W.#rStop|
|00003eb0| 52 65 63 74 2c 2d 28 53 | 50 29 09 3b 20 70 61 73 |Rect,-(S|P).; pas|
|00003ec0| 73 20 74 68 65 20 73 74 | 6f 70 20 6c 69 67 68 74 |s the st|op light|
|00003ed0| 27 73 20 72 65 63 74 0d | 09 09 50 45 41 09 47 2e |'s rect.|..PEA.G.|
|00003ee0| 53 74 6f 70 52 65 63 74 | 09 09 3b 20 70 61 73 73 |StopRect|..; pass|
|00003ef0| 20 74 68 65 20 73 74 6f | 70 20 6c 69 67 68 74 27 | the sto|p light'|
|00003f00| 73 20 72 65 63 74 20 70 | 6f 69 6e 74 65 72 0d 09 |s rect p|ointer..|
|00003f10| 09 42 53 52 09 47 6f 47 | 65 74 52 65 63 74 09 09 |.BSR.GoG|etRect..|
|00003f20| 3b 20 67 6f 20 67 65 74 | 20 74 68 65 20 73 74 6f |; go get| the sto|
|00003f30| 70 20 6c 69 67 68 74 20 | 72 65 63 74 0d 09 09 4d |p light |rect...M|
|00003f40| 4f 56 45 2e 57 09 28 53 | 50 29 2b 2c 44 30 09 09 |OVE.W.(S|P)+,D0..|
|00003f50| 3b 20 67 65 74 20 74 68 | 65 20 72 65 73 75 6c 74 |; get th|e result|
|00003f60| 20 6f 66 20 47 6f 47 65 | 74 52 65 63 74 0d 09 09 | of GoGe|tRect...|
|00003f70| 43 4d 50 49 2e 57 09 23 | 54 72 75 65 2c 44 30 09 |CMPI.W.#|True,D0.|
|00003f80| 09 3b 20 64 69 64 20 77 | 65 20 67 65 74 20 74 68 |.; did w|e get th|
|00003f90| 65 20 52 45 43 54 20 72 | 65 73 6f 75 72 63 65 3f |e RECT r|esource?|
|00003fa0| 0d 09 09 42 45 51 2e 53 | 09 40 36 09 09 09 3b 20 |...BEQ.S|.@6...; |
|00003fb0| 79 65 73 2c 20 74 68 65 | 6e 20 63 6f 6e 74 69 6e |yes, the|n contin|
|00003fc0| 75 65 0d 09 09 4a 4d 50 | 09 41 6c 65 72 74 55 73 |ue...JMP|.AlertUs|
|00003fd0| 65 72 09 09 3b 20 6f 74 | 68 65 72 77 69 73 65 2c |er..; ot|herwise,|
|00003fe0| 20 77 65 27 72 65 20 68 | 61 76 69 6e 67 20 73 6f | we're h|aving so|
|00003ff0| 6d 65 20 74 72 6f 75 62 | 6c 65 0d 09 09 0d 40 36 |me troub|le....@6|
|00004000| 09 09 43 4c 52 2e 57 09 | 2d 28 53 50 29 09 09 09 |..CLR.W.|-(SP)...|
|00004010| 3b 20 73 70 61 63 65 20 | 66 6f 72 20 72 65 73 75 |; space |for resu|
|00004020| 6c 74 20 6f 66 20 47 6f | 47 65 74 52 65 63 74 0d |lt of Go|GetRect.|
|00004030| 09 09 4d 4f 56 45 2e 57 | 09 23 72 47 6f 52 65 63 |..MOVE.W|.#rGoRec|
|00004040| 74 2c 2d 28 53 50 29 09 | 09 3b 20 70 61 73 73 20 |t,-(SP).|.; pass |
|00004050| 74 68 65 20 67 6f 20 6c | 69 67 68 74 27 73 20 72 |the go l|ight's r|
|00004060| 65 63 74 0d 09 09 50 45 | 41 09 47 2e 47 6f 52 65 |ect...PE|A.G.GoRe|
|00004070| 63 74 09 09 3b 20 70 61 | 73 73 20 74 68 65 20 67 |ct..; pa|ss the g|
|00004080| 6f 20 6c 69 67 68 74 27 | 73 20 72 65 63 74 20 70 |o light'|s rect p|
|00004090| 6f 69 6e 74 65 72 0d 09 | 09 42 53 52 09 47 6f 47 |ointer..|.BSR.GoG|
|000040a0| 65 74 52 65 63 74 09 09 | 3b 20 67 6f 20 67 65 74 |etRect..|; go get|
|000040b0| 20 74 68 65 20 67 6f 20 | 6c 69 67 68 74 20 72 65 | the go |light re|
|000040c0| 63 74 0d 09 09 4d 4f 56 | 45 2e 57 09 28 53 50 29 |ct...MOV|E.W.(SP)|
|000040d0| 2b 2c 44 30 09 09 3b 20 | 67 65 74 20 74 68 65 20 |+,D0..; |get the |
|000040e0| 72 65 73 75 6c 74 20 6f | 66 20 47 6f 47 65 74 52 |result o|f GoGetR|
|000040f0| 65 63 74 0d 09 09 43 4d | 50 49 2e 57 09 23 54 72 |ect...CM|PI.W.#Tr|
|00004100| 75 65 2c 44 30 09 09 3b | 20 64 69 64 20 77 65 20 |ue,D0..;| did we |
|00004110| 67 65 74 20 74 68 65 20 | 52 45 43 54 20 72 65 73 |get the |RECT res|
|00004120| 6f 75 72 63 65 3f 0d 09 | 09 42 45 51 2e 53 09 45 |ource?..|.BEQ.S.E|
|00004130| 78 69 74 09 09 09 3b 20 | 79 65 73 2c 20 74 68 65 |xit...; |yes, the|
|00004140| 6e 20 63 6f 6e 74 69 6e | 75 65 0d 09 09 4a 4d 50 |n contin|ue...JMP|
|00004150| 09 41 6c 65 72 74 55 73 | 65 72 09 09 3b 20 6f 74 |.AlertUs|er..; ot|
|00004160| 68 65 72 77 69 73 65 2c | 20 77 65 27 72 65 20 68 |herwise,| we're h|
|00004170| 61 76 69 6e 67 20 73 6f | 6d 65 20 74 72 6f 75 62 |aving so|me troub|
|00004180| 6c 65 0d 09 09 09 09 0d | 45 78 69 74 09 09 4d 4f |le......|Exit..MO|
|00004190| 56 45 4d 2e 4c 09 28 53 | 50 29 2b 2c 43 6f 75 6e |VEM.L.(S|P)+,Coun|
|000041a0| 74 52 65 67 2f 54 72 61 | 70 41 64 72 73 52 65 67 |tReg/Tra|pAdrsReg|
|000041b0| 20 3b 20 72 65 73 74 6f | 72 65 20 74 68 65 20 72 | ; resto|re the r|
|000041c0| 65 67 69 73 74 6f 72 73 | 0d 09 09 55 4e 4c 4b 09 |egistors|...UNLK.|
|000041d0| 41 36 09 09 09 3b 20 64 | 65 73 74 72 6f 79 20 74 |A6...; d|estroy t|
|000041e0| 68 65 20 6c 69 6e 6b 0d | 09 09 4d 4f 56 45 41 2e |he link.|..MOVEA.|
|000041f0| 4c 09 28 53 50 29 2b 2c | 41 30 09 09 3b 20 70 75 |L.(SP)+,|A0..; pu|
|00004200| 6c 6c 20 6f 66 66 20 74 | 68 65 20 72 65 74 75 72 |ll off t|he retur|
|00004210| 6e 20 61 64 64 72 65 73 | 73 0d 09 09 41 44 44 41 |n addres|s...ADDA|
|00004220| 2e 4c 09 23 50 61 72 61 | 6d 53 69 7a 65 2c 53 50 |.L.#Para|mSize,SP|
|00004230| 09 09 3b 20 73 74 72 69 | 70 20 61 6c 6c 20 6f 66 |..; stri|p all of|
|00004240| 20 74 68 65 20 63 61 6c | 6c 65 72 27 73 20 70 61 | the cal|ler's pa|
|00004250| 72 61 6d 65 74 65 72 73 | 0d 09 09 4a 4d 50 09 28 |rameters|...JMP.(|
|00004260| 41 30 29 09 09 09 3b 20 | 72 65 74 75 72 6e 20 74 |A0)...; |return t|
|00004270| 6f 20 74 68 65 20 63 61 | 6c 6c 65 72 0d 0d 09 09 |o the ca|ller....|
|00004280| 44 62 67 49 6e 66 6f 09 | 49 6e 69 74 69 61 6c 7a |DbgInfo.|Initialz|
|00004290| 09 09 3b 20 74 68 69 73 | 20 6e 61 6d 65 20 77 69 |..; this| name wi|
|000042a0| 6c 6c 20 61 70 70 65 61 | 72 20 69 6e 20 74 68 65 |ll appea|r in the|
|000042b0| 20 64 65 62 75 67 67 65 | 72 0d 09 09 45 4e 44 50 | debugge|r...ENDP|
|000042c0| 0d 0d 2a 20 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |..* ====|========|
|000042d0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000042e0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000042f0| 3d 3d 3d 3d 0d 2a 20 50 | 52 4f 43 45 44 55 52 45 |====.* P|ROCEDURE|
|00004300| 20 44 6f 43 6f 6e 74 65 | 6e 74 43 6c 69 63 6b 28 | DoConte|ntClick(|
|00004310| 77 69 6e 64 6f 77 3a 20 | 57 69 6e 64 6f 77 50 74 |window: |WindowPt|
|00004320| 72 3b 20 65 76 65 6e 74 | 3a 20 45 76 65 6e 74 52 |r; event|: EventR|
|00004330| 65 63 6f 72 64 29 3b 0d | 2a 20 3d 3d 3d 3d 3d 3d |ecord);.|* ======|
|00004340| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00004350| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00004360| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 0d 2a 20 54 68 69 |========|==.* Thi|
|00004370| 73 20 69 73 20 63 61 6c | 6c 65 64 20 77 68 65 6e |s is cal|led when|
|00004380| 20 61 20 6d 6f 75 73 65 | 2d 64 6f 77 6e 20 65 76 | a mouse|-down ev|
|00004390| 65 6e 74 20 6f 63 63 75 | 72 73 20 69 6e 20 74 68 |ent occu|rs in th|
|000043a0| 65 20 63 6f 6e 74 65 6e | 74 20 6f 66 20 61 20 77 |e conten|t of a w|
|000043b0| 69 6e 64 6f 77 2e 0d 2a | 20 4f 74 68 65 72 20 61 |indow..*| Other a|
|000043c0| 70 70 6c 69 63 61 74 69 | 6f 6e 73 20 6d 69 67 68 |pplicati|ons migh|
|000043d0| 74 20 77 61 6e 74 20 74 | 6f 20 63 61 6c 6c 20 46 |t want t|o call F|
|000043e0| 69 6e 64 43 6f 6e 74 72 | 6f 6c 2c 20 54 45 43 6c |indContr|ol, TECl|
|000043f0| 69 63 6b 2c 20 65 74 63 | 2e 2c 20 74 6f 0d 2a 20 |ick, etc|., to.* |
|00004400| 66 75 72 74 68 65 72 20 | 70 72 6f 63 65 73 73 20 |further |process |
|00004410| 74 68 65 20 63 6c 69 63 | 6b 2e 0d 20 0d 09 09 53 |the clic|k.. ...S|
|00004420| 45 47 09 27 4d 61 69 6e | 27 09 09 09 3b 20 63 61 |EG.'Main|'...; ca|
|00004430| 73 65 20 73 65 6e 73 69 | 74 69 76 65 0d 44 6f 43 |se sensi|tive.DoC|
|00004440| 6f 6e 74 65 6e 74 43 6c | 69 63 6b 09 50 52 4f 43 |ontentCl|ick.PROC|
|00004450| 0d 0d 53 74 61 63 6b 46 | 72 61 6d 65 09 52 45 43 |..StackF|rame.REC|
|00004460| 4f 52 44 09 7b 41 36 4c | 69 6e 6b 7d 2c 44 45 43 |ORD.{A6L|ink},DEC|
|00004470| 52 09 09 3b 20 62 75 69 | 6c 64 20 61 20 73 74 61 |R..; bui|ld a sta|
|00004480| 63 6b 20 66 72 61 6d 65 | 20 72 65 63 6f 72 64 0d |ck frame| record.|
|00004490| 50 61 72 61 6d 42 65 67 | 69 6e 09 45 51 55 09 2a |ParamBeg|in.EQU.*|
|000044a0| 09 09 09 3b 20 73 74 61 | 72 74 20 70 61 72 61 6d |...; sta|rt param|
|000044b0| 65 74 65 72 73 20 61 66 | 74 65 72 20 74 68 69 73 |eters af|ter this|
|000044c0| 20 70 6f 69 6e 74 0d 57 | 69 6e 64 6f 77 50 74 72 | point.W|indowPtr|
|000044d0| 09 44 53 2e 4c 09 31 09 | 09 09 3b 20 70 61 73 73 |.DS.L.1.|..; pass|
|000044e0| 65 64 20 70 61 72 61 6d | 65 74 65 72 20 6f 66 20 |ed param|eter of |
|000044f0| 74 68 65 20 77 69 6e 64 | 6f 77 20 70 6f 69 6e 74 |the wind|ow point|
|00004500| 65 72 0d 45 76 65 6e 74 | 50 74 72 09 44 53 2e 4c |er.Event|Ptr.DS.L|
|00004510| 09 31 09 09 09 3b 20 70 | 6f 69 6e 74 65 72 20 74 |.1...; p|ointer t|
|00004520| 6f 20 74 68 65 20 65 76 | 65 6e 74 20 72 65 63 6f |o the ev|ent reco|
|00004530| 72 64 0d 50 61 72 61 6d | 53 69 7a 65 09 45 51 55 |rd.Param|Size.EQU|
|00004540| 09 50 61 72 61 6d 42 65 | 67 69 6e 2d 2a 09 09 3b |.ParamBe|gin-*..;|
|00004550| 20 73 69 7a 65 20 6f 66 | 20 61 6c 6c 20 74 68 65 | size of| all the|
|00004560| 20 70 61 73 73 65 64 20 | 70 61 72 61 6d 65 74 65 | passed |paramete|
|00004570| 72 73 0d 52 65 74 41 64 | 64 72 20 09 44 53 2e 4c |rs.RetAd|dr .DS.L|
|00004580| 09 31 09 09 09 3b 20 70 | 6c 61 63 65 20 68 6f 6c |.1...; p|lace hol|
|00004590| 64 65 72 20 66 6f 72 20 | 72 65 74 75 72 6e 20 61 |der for |return a|
|000045a0| 64 64 72 65 73 73 0d 41 | 36 4c 69 6e 6b 09 09 44 |ddress.A|6Link..D|
|000045b0| 53 2e 4c 09 31 09 09 09 | 3b 20 70 6c 61 63 65 20 |S.L.1...|; place |
|000045c0| 68 6f 6c 64 65 72 20 66 | 6f 72 20 41 36 20 6c 69 |holder f|or A6 li|
|000045d0| 6e 6b 0d 4c 6f 63 61 6c | 53 69 7a 65 09 45 51 55 |nk.Local|Size.EQU|
|000045e0| 20 09 2a 09 09 09 3b 20 | 73 69 7a 65 20 6f 66 20 | .*...; |size of |
|000045f0| 61 6c 6c 20 74 68 65 20 | 6c 6f 63 61 6c 20 76 61 |all the |local va|
|00004600| 72 69 61 62 6c 65 73 0d | 09 09 45 4e 44 52 0d 09 |riables.|..ENDR..|
|00004610| 09 0d 09 09 49 4d 50 4f | 52 54 09 53 65 74 4c 69 |....IMPO|RT.SetLi|
|00004620| 67 68 74 0d 0d 09 09 57 | 49 54 48 09 53 74 61 63 |ght....W|ITH.Stac|
|00004630| 6b 46 72 61 6d 65 09 09 | 3b 20 63 6f 76 65 72 20 |kFrame..|; cover |
|00004640| 6f 75 72 20 6c 6f 63 61 | 6c 20 73 74 61 63 6b 20 |our loca|l stack |
|00004650| 66 72 61 6d 65 0d 09 09 | 4c 49 4e 4b 09 41 36 2c |frame...|LINK.A6,|
|00004660| 23 4c 6f 63 61 6c 53 69 | 7a 65 09 09 3b 20 61 6c |#LocalSi|ze..; al|
|00004670| 6c 6f 63 61 74 65 20 6f | 75 72 20 6c 6f 63 61 6c |locate o|ur local|
|00004680| 20 73 74 61 63 6b 20 66 | 72 61 6d 65 0d 0d 20 09 | stack f|rame.. .|
|00004690| 09 4d 4f 56 45 2e 4c 09 | 57 69 6e 64 6f 77 50 74 |.MOVE.L.|WindowPt|
|000046a0| 72 28 41 36 29 2c 2d 28 | 53 50 29 09 3b 20 70 61 |r(A6),-(|SP).; pa|
|000046b0| 73 73 20 74 68 65 20 77 | 69 6e 64 6f 77 20 70 6f |ss the w|indow po|
|000046c0| 69 6e 74 65 72 0d 09 09 | 4d 4f 56 45 2e 57 09 47 |inter...|MOVE.W.G|
|000046d0| 2e 53 74 6f 70 70 65 64 | 2c 44 30 09 09 3b 20 67 |.Stopped|,D0..; g|
|000046e0| 65 74 20 63 75 72 72 65 | 6e 74 20 73 74 61 74 65 |et curre|nt state|
|000046f0| 20 6f 66 20 74 68 65 20 | 6c 69 67 68 74 0d 09 09 | of the |light...|
|00004700| 45 4f 52 49 2e 57 09 23 | 54 72 75 65 2c 44 30 09 |EORI.W.#|True,D0.|
|00004710| 09 3b 20 65 78 63 6c 75 | 73 69 76 65 20 4f 52 20 |.; exclu|sive OR |
|00004720| 74 68 65 20 63 75 72 72 | 65 6e 74 20 73 74 61 74 |the curr|ent stat|
|00004730| 65 0d 09 09 4d 4f 56 45 | 2e 57 09 44 30 2c 2d 28 |e...MOVE|.W.D0,-(|
|00004740| 53 50 29 09 09 3b 20 70 | 61 73 73 20 6e 65 77 20 |SP)..; p|ass new |
|00004750| 73 74 61 74 65 20 74 6f | 20 73 77 69 74 63 68 20 |state to| switch |
|00004760| 6c 69 67 68 74 0d 09 09 | 42 53 52 09 53 65 74 4c |light...|BSR.SetL|
|00004770| 69 67 68 74 09 09 3b 20 | 73 65 74 20 74 68 65 20 |ight..; |set the |
|00004780| 74 72 61 66 66 69 63 20 | 6c 69 67 68 74 0d 0d 45 |traffic |light..E|
|00004790| 78 69 74 09 09 55 4e 4c | 4b 09 41 36 09 09 09 3b |xit..UNL|K.A6...;|
|000047a0| 20 64 65 73 74 72 6f 79 | 20 74 68 65 20 6c 69 6e | destroy| the lin|
|000047b0| 6b 0d 09 09 4d 4f 56 45 | 41 2e 4c 09 28 53 50 29 |k...MOVE|A.L.(SP)|
|000047c0| 2b 2c 41 30 09 09 3b 20 | 70 75 6c 6c 20 6f 66 66 |+,A0..; |pull off|
|000047d0| 20 74 68 65 20 72 65 74 | 75 72 6e 20 61 64 64 72 | the ret|urn addr|
|000047e0| 65 73 73 0d 09 09 41 44 | 44 41 2e 4c 09 23 50 61 |ess...AD|DA.L.#Pa|
|000047f0| 72 61 6d 53 69 7a 65 2c | 53 50 09 09 3b 20 73 74 |ramSize,|SP..; st|
|00004800| 72 69 70 20 61 6c 6c 20 | 6f 66 20 74 68 65 20 63 |rip all |of the c|
|00004810| 61 6c 6c 65 72 27 73 20 | 70 61 72 61 6d 65 74 65 |aller's |paramete|
|00004820| 72 73 0d 09 09 4a 4d 50 | 09 28 41 30 29 09 09 09 |rs...JMP|.(A0)...|
|00004830| 3b 20 72 65 74 75 72 6e | 20 74 6f 20 74 68 65 20 |; return| to the |
|00004840| 63 61 6c 6c 65 72 0d 0d | 09 09 44 62 67 49 6e 66 |caller..|..DbgInf|
|00004850| 6f 09 44 6f 43 6f 6e 74 | 6e 74 09 09 3b 20 74 68 |o.DoCont|nt..; th|
|00004860| 69 73 20 6e 61 6d 65 20 | 77 69 6c 6c 20 61 70 70 |is name |will app|
|00004870| 65 61 72 20 69 6e 20 74 | 68 65 20 64 65 62 75 67 |ear in t|he debug|
|00004880| 67 65 72 0d 09 09 45 4e | 44 50 0d 0d 2a 20 3d 3d |ger...EN|DP..* ==|
|00004890| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000048a0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000048b0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 0d 2a |========|======.*|
|000048c0| 20 50 52 4f 43 45 44 55 | 52 45 20 44 6f 55 70 64 | PROCEDU|RE DoUpd|
|000048d0| 61 74 65 28 77 69 6e 64 | 6f 77 3a 20 57 69 6e 64 |ate(wind|ow: Wind|
|000048e0| 6f 77 50 74 72 29 3b 0d | 2a 20 3d 3d 3d 3d 3d 3d |owPtr);.|* ======|
|000048f0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00004900| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00004910| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 0d 2a 20 54 68 69 |========|==.* Thi|
|00004920| 73 20 69 73 20 63 61 6c | 6c 65 64 20 77 68 65 6e |s is cal|led when|
|00004930| 20 61 6e 20 75 70 64 61 | 74 65 20 65 76 65 6e 74 | an upda|te event|
|00004940| 20 69 73 20 72 65 63 65 | 69 76 65 64 20 66 6f 72 | is rece|ived for|
|00004950| 20 61 20 77 69 6e 64 6f | 77 2e 0d 2a 20 49 74 20 | a windo|w..* It |
|00004960| 63 61 6c 6c 73 20 44 72 | 61 77 57 69 6e 64 6f 77 |calls Dr|awWindow|
|00004970| 20 74 6f 20 64 72 61 77 | 20 74 68 65 20 63 6f 6e | to draw| the con|
|00004980| 74 65 6e 74 73 20 6f 66 | 20 61 6e 20 61 70 70 6c |tents of| an appl|
|00004990| 69 63 61 74 69 6f 6e 20 | 77 69 6e 64 6f 77 2e 0d |ication |window..|
|000049a0| 2a 20 41 73 20 61 6e 20 | 65 66 66 69 63 69 65 6e |* As an |efficien|
|000049b0| 63 79 20 6d 65 61 73 75 | 72 65 20 74 68 61 74 20 |cy measu|re that |
|000049c0| 64 6f 65 73 20 6e 6f 74 | 20 68 61 76 65 20 74 6f |does not| have to|
|000049d0| 20 62 65 20 66 6f 6c 6c | 6f 77 65 64 2c 20 69 74 | be foll|owed, it|
|000049e0| 0d 2a 20 63 61 6c 6c 73 | 20 74 68 65 20 64 72 61 |.* calls| the dra|
|000049f0| 77 69 6e 67 20 72 6f 75 | 74 69 6e 65 20 6f 6e 6c |wing rou|tine onl|
|00004a00| 79 20 69 66 20 74 68 65 | 20 76 69 73 52 67 6e 20 |y if the| visRgn |
|00004a10| 69 73 20 6e 6f 6e 2d 65 | 6d 70 74 79 2e 20 54 68 |is non-e|mpty. Th|
|00004a20| 69 73 0d 2a 20 77 69 6c | 6c 20 68 61 6e 64 6c 65 |is.* wil|l handle|
|00004a30| 20 73 69 74 75 61 74 69 | 6f 6e 73 20 77 68 65 72 | situati|ons wher|
|00004a40| 65 20 63 61 6c 63 75 6c | 61 74 69 6f 6e 73 20 66 |e calcul|ations f|
|00004a50| 6f 72 20 64 72 61 77 69 | 6e 67 20 6f 72 20 64 72 |or drawi|ng or dr|
|00004a60| 61 77 69 6e 67 0d 2a 20 | 69 74 73 65 6c 66 20 69 |awing.* |itself i|
|00004a70| 73 20 76 65 72 79 20 74 | 69 6d 65 2d 63 6f 6e 73 |s very t|ime-cons|
|00004a80| 75 6d 69 6e 67 2e 0d 0d | 09 09 53 45 47 09 27 4d |uming...|..SEG.'M|
|00004a90| 61 69 6e 27 09 09 09 3b | 20 63 61 73 65 20 73 65 |ain'...;| case se|
|00004aa0| 6e 73 69 74 69 76 65 0d | 44 6f 55 70 64 61 74 65 |nsitive.|DoUpdate|
|00004ab0| 09 50 52 4f 43 0d 0d 53 | 74 61 63 6b 46 72 61 6d |.PROC..S|tackFram|
|00004ac0| 65 09 52 45 43 4f 52 44 | 09 7b 41 36 4c 69 6e 6b |e.RECORD|.{A6Link|
|00004ad0| 7d 2c 44 45 43 52 09 09 | 3b 20 62 75 69 6c 64 20 |},DECR..|; build |
|00004ae0| 61 20 73 74 61 63 6b 20 | 66 72 61 6d 65 20 72 65 |a stack |frame re|
|00004af0| 63 6f 72 64 0d 50 61 72 | 61 6d 42 65 67 69 6e 09 |cord.Par|amBegin.|
|00004b00| 45 51 55 09 2a 09 09 09 | 3b 20 73 74 61 72 74 20 |EQU.*...|; start |
|00004b10| 70 61 72 61 6d 65 74 65 | 72 73 20 61 66 74 65 72 |paramete|rs after|
|00004b20| 20 74 68 69 73 20 70 6f | 69 6e 74 0d 57 69 6e 64 | this po|int.Wind|
|00004b30| 6f 77 50 74 72 09 44 53 | 2e 4c 09 31 09 09 09 3b |owPtr.DS|.L.1...;|
|00004b40| 20 70 61 73 73 65 64 20 | 70 61 72 61 6d 65 74 65 | passed |paramete|
|00004b50| 72 20 6f 66 20 74 68 65 | 20 77 69 6e 64 6f 77 20 |r of the| window |
|00004b60| 70 6f 69 6e 74 65 72 0d | 50 61 72 61 6d 53 69 7a |pointer.|ParamSiz|
|00004b70| 65 09 45 51 55 09 50 61 | 72 61 6d 42 65 67 69 6e |e.EQU.Pa|ramBegin|
|00004b80| 2d 2a 09 09 3b 20 73 69 | 7a 65 20 6f 66 20 61 6c |-*..; si|ze of al|
|00004b90| 6c 20 74 68 65 20 70 61 | 73 73 65 64 20 70 61 72 |l the pa|ssed par|
|00004ba0| 61 6d 65 74 65 72 73 0d | 52 65 74 41 64 64 72 20 |ameters.|RetAddr |
|00004bb0| 09 44 53 2e 4c 09 31 09 | 09 09 3b 20 70 6c 61 63 |.DS.L.1.|..; plac|
|00004bc0| 65 20 68 6f 6c 64 65 72 | 20 66 6f 72 20 72 65 74 |e holder| for ret|
|00004bd0| 75 72 6e 20 61 64 64 72 | 65 73 73 0d 41 36 4c 69 |urn addr|ess.A6Li|
|00004be0| 6e 6b 09 09 44 53 2e 4c | 09 31 09 09 09 3b 20 70 |nk..DS.L|.1...; p|
|00004bf0| 6c 61 63 65 20 68 6f 6c | 64 65 72 20 66 6f 72 20 |lace hol|der for |
|00004c00| 41 36 20 6c 69 6e 6b 0d | 4c 6f 63 61 6c 53 69 7a |A6 link.|LocalSiz|
|00004c10| 65 09 45 51 55 20 09 2a | 09 09 09 3b 20 73 69 7a |e.EQU .*|...; siz|
|00004c20| 65 20 6f 66 20 61 6c 6c | 20 74 68 65 20 6c 6f 63 |e of all| the loc|
|00004c30| 61 6c 20 76 61 72 69 61 | 62 6c 65 73 0d 09 09 45 |al varia|bles...E|
|00004c40| 4e 44 52 0d 09 09 0d 09 | 09 49 4d 50 4f 52 54 09 |NDR.....|.IMPORT.|
|00004c50| 49 73 41 70 70 57 69 6e | 64 6f 77 2c 44 72 61 77 |IsAppWin|dow,Draw|
|00004c60| 57 69 6e 64 6f 77 0d 0d | 09 09 57 49 54 48 09 53 |Window..|..WITH.S|
|00004c70| 74 61 63 6b 46 72 61 6d | 65 09 09 3b 20 63 6f 76 |tackFram|e..; cov|
|00004c80| 65 72 20 6f 75 72 20 6c | 6f 63 61 6c 20 73 74 61 |er our l|ocal sta|
|00004c90| 63 6b 20 66 72 61 6d 65 | 0d 09 09 4c 49 4e 4b 09 |ck frame|...LINK.|
|00004ca0| 41 36 2c 23 4c 6f 63 61 | 6c 53 69 7a 65 09 09 3b |A6,#Loca|lSize..;|
|00004cb0| 20 61 6c 6c 6f 63 61 74 | 65 20 6f 75 72 20 6c 6f | allocat|e our lo|
|00004cc0| 63 61 6c 20 73 74 61 63 | 6b 20 66 72 61 6d 65 0d |cal stac|k frame.|
|00004cd0| 0d 09 09 43 4c 52 2e 57 | 09 2d 28 53 50 29 09 09 |...CLR.W|.-(SP)..|
|00004ce0| 09 3b 20 73 70 61 63 65 | 20 66 6f 72 20 72 65 73 |.; space| for res|
|00004cf0| 75 6c 74 20 6f 66 20 49 | 73 41 70 70 57 69 6e 64 |ult of I|sAppWind|
|00004d00| 6f 77 0d 09 09 4d 4f 56 | 45 2e 4c 09 57 69 6e 64 |ow...MOV|E.L.Wind|
|00004d10| 6f 77 50 74 72 28 41 36 | 29 2c 2d 28 53 50 29 09 |owPtr(A6|),-(SP).|
|00004d20| 3b 20 70 61 73 73 20 74 | 68 65 20 77 69 6e 64 6f |; pass t|he windo|
|00004d30| 77 20 70 6f 69 6e 74 65 | 72 0d 09 09 42 53 52 09 |w pointe|r...BSR.|
|00004d40| 49 73 41 70 70 57 69 6e | 64 6f 77 09 09 3b 20 74 |IsAppWin|dow..; t|
|00004d50| 65 73 74 20 69 66 20 74 | 68 69 73 20 77 69 6e 64 |est if t|his wind|
|00004d60| 6f 77 20 77 61 73 20 6f | 75 72 73 0d 09 09 4d 4f |ow was o|urs...MO|
|00004d70| 56 45 2e 57 09 28 53 50 | 29 2b 2c 44 30 09 09 0d |VE.W.(SP|)+,D0...|
|00004d80| 09 09 43 4d 50 49 2e 57 | 09 23 54 72 75 65 2c 44 |..CMPI.W|.#True,D|
|00004d90| 30 09 09 3b 20 69 74 20 | 6d 75 73 74 20 62 65 20 |0..; it |must be |
|00004da0| 6f 75 72 20 77 69 6e 64 | 6f 77 0d 09 09 42 4e 45 |our wind|ow...BNE|
|00004db0| 2e 53 09 45 78 69 74 09 | 09 09 3b 20 69 74 20 77 |.S.Exit.|..; it w|
|00004dc0| 61 73 6e 27 74 20 6f 75 | 72 20 77 69 6e 64 6f 77 |asn't ou|r window|
|00004dd0| 0d 09 09 0d 09 09 4d 4f | 56 45 2e 4c 09 57 69 6e |......MO|VE.L.Win|
|00004de0| 64 6f 77 50 74 72 28 41 | 36 29 2c 2d 28 53 50 29 |dowPtr(A|6),-(SP)|
|00004df0| 09 3b 20 75 70 64 61 74 | 65 20 6f 6e 6c 79 20 74 |.; updat|e only t|
|00004e00| 68 65 20 76 69 73 69 62 | 6c 65 20 72 65 67 69 6f |he visib|le regio|
|00004e10| 6e 0d 09 09 5f 42 65 67 | 69 6e 55 70 44 61 74 65 |n..._Beg|inUpDate|
|00004e20| 09 09 09 3b 20 72 65 67 | 69 6f 6e 20 6f 66 20 74 |...; reg|ion of t|
|00004e30| 68 65 20 77 69 6e 64 6f | 77 0d 09 09 43 4c 52 2e |he windo|w...CLR.|
|00004e40| 57 09 2d 28 53 50 29 09 | 09 09 3b 20 73 70 61 63 |W.-(SP).|..; spac|
|00004e50| 65 20 66 6f 72 20 72 65 | 73 75 6c 74 0d 09 09 4d |e for re|sult...M|
|00004e60| 4f 56 45 41 2e 4c 09 57 | 69 6e 64 6f 77 50 74 72 |OVEA.L.W|indowPtr|
|00004e70| 28 41 36 29 2c 41 30 09 | 3b 20 74 68 65 20 77 69 |(A6),A0.|; the wi|
|00004e80| 6e 64 6f 77 20 70 6f 69 | 6e 74 65 72 0d 09 09 4d |ndow poi|nter...M|
|00004e90| 4f 56 45 2e 4c 09 76 69 | 73 52 67 6e 28 41 30 29 |OVE.L.vi|sRgn(A0)|
|00004ea0| 2c 2d 28 53 50 29 09 3b | 20 74 68 65 20 77 69 6e |,-(SP).;| the win|
|00004eb0| 64 6f 77 27 73 20 76 69 | 73 52 67 6e 20 68 61 6e |dow's vi|sRgn han|
|00004ec0| 64 6c 65 0d 09 09 5f 45 | 6d 70 74 79 52 67 6e 0d |dle..._E|mptyRgn.|
|00004ed0| 09 09 4d 4f 56 45 2e 57 | 09 28 53 50 29 2b 2c 44 |..MOVE.W|.(SP)+,D|
|00004ee0| 30 09 09 3b 20 72 65 73 | 75 6c 74 20 6f 66 20 45 |0..; res|ult of E|
|00004ef0| 6d 70 74 79 52 67 6e 0d | 09 09 43 4d 50 49 2e 57 |mptyRgn.|..CMPI.W|
|00004f00| 09 23 54 72 75 65 2c 44 | 30 09 09 3b 20 77 61 73 |.#True,D|0..; was|
|00004f10| 20 74 68 65 20 76 69 73 | 52 67 6e 20 65 6d 70 74 | the vis|Rgn empt|
|00004f20| 79 3f 0d 09 09 42 45 51 | 2e 53 09 40 31 09 09 09 |y?...BEQ|.S.@1...|
|00004f30| 3b 20 79 65 73 2c 20 74 | 68 65 6e 20 6e 6f 20 75 |; yes, t|hen no u|
|00004f40| 70 64 61 74 65 20 69 73 | 20 6e 65 65 64 65 64 0d |pdate is| needed.|
|00004f50| 09 09 0d 09 09 4d 4f 56 | 45 2e 4c 09 57 69 6e 64 |.....MOV|E.L.Wind|
|00004f60| 6f 77 50 74 72 28 41 36 | 29 2c 2d 28 53 50 29 0d |owPtr(A6|),-(SP).|
|00004f70| 09 09 42 53 52 09 44 72 | 61 77 57 69 6e 64 6f 77 |..BSR.Dr|awWindow|
|00004f80| 09 09 3b 20 64 72 61 77 | 20 74 68 65 20 74 72 61 |..; draw| the tra|
|00004f90| 66 66 69 63 20 6c 69 67 | 68 74 73 0d 09 09 0d 40 |ffic lig|hts....@|
|00004fa0| 31 09 09 4d 4f 56 45 2e | 4c 09 57 69 6e 64 6f 77 |1..MOVE.|L.Window|
|00004fb0| 50 74 72 28 41 36 29 2c | 2d 28 53 50 29 09 3b 20 |Ptr(A6),|-(SP).; |
|00004fc0| 67 65 74 20 70 6f 69 6e | 74 65 72 20 74 6f 20 77 |get poin|ter to w|
|00004fd0| 69 6e 64 6f 77 0d 09 09 | 5f 45 6e 64 55 70 64 61 |indow...|_EndUpda|
|00004fe0| 74 65 0d 0d 45 78 69 74 | 09 09 55 4e 4c 4b 09 41 |te..Exit|..UNLK.A|
|00004ff0| 36 09 09 09 3b 20 64 65 | 73 74 72 6f 79 20 74 68 |6...; de|stroy th|
|00005000| 65 20 6c 69 6e 6b 0d 09 | 09 4d 4f 56 45 41 2e 4c |e link..|.MOVEA.L|
|00005010| 09 28 53 50 29 2b 2c 41 | 30 09 09 3b 20 70 75 6c |.(SP)+,A|0..; pul|
|00005020| 6c 20 6f 66 66 20 74 68 | 65 20 72 65 74 75 72 6e |l off th|e return|
|00005030| 20 61 64 64 72 65 73 73 | 0d 09 09 41 44 44 41 2e | address|...ADDA.|
|00005040| 4c 09 23 50 61 72 61 6d | 53 69 7a 65 2c 53 50 09 |L.#Param|Size,SP.|
|00005050| 09 3b 20 73 74 72 69 70 | 20 61 6c 6c 20 6f 66 20 |.; strip| all of |
|00005060| 74 68 65 20 63 61 6c 6c | 65 72 27 73 20 70 61 72 |the call|er's par|
|00005070| 61 6d 65 74 65 72 73 0d | 09 09 4a 4d 50 09 28 41 |ameters.|..JMP.(A|
|00005080| 30 29 09 09 09 3b 20 72 | 65 74 75 72 6e 20 74 6f |0)...; r|eturn to|
|00005090| 20 74 68 65 20 63 61 6c | 6c 65 72 0d 0d 09 09 44 | the cal|ler....D|
|000050a0| 62 67 49 6e 66 6f 09 44 | 6f 55 70 64 61 74 65 09 |bgInfo.D|oUpdate.|
|000050b0| 09 3b 20 74 68 69 73 20 | 6e 61 6d 65 20 77 69 6c |.; this |name wil|
|000050c0| 6c 20 61 70 70 65 61 72 | 20 69 6e 20 74 68 65 20 |l appear| in the |
|000050d0| 64 65 62 75 67 67 65 72 | 0d 09 09 45 4e 44 50 0d |debugger|...ENDP.|
|000050e0| 0d 2a 20 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |.* =====|========|
|000050f0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00005100| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00005110| 3d 3d 3d 0d 2a 20 50 52 | 4f 43 45 44 55 52 45 20 |===.* PR|OCEDURE |
|00005120| 44 6f 41 63 74 69 76 61 | 74 65 28 77 69 6e 64 6f |DoActiva|te(windo|
|00005130| 77 3a 20 57 69 6e 64 6f | 77 50 74 72 3b 20 62 65 |w: Windo|wPtr; be|
|00005140| 63 6f 6d 69 6e 67 41 63 | 74 69 76 65 3a 20 42 4f |comingAc|tive: BO|
|00005150| 4f 4c 45 41 4e 29 3b 0d | 2a 20 3d 3d 3d 3d 3d 3d |OLEAN);.|* ======|
|00005160| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00005170| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00005180| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 0d 2a 20 49 6e 20 |========|==.* In |
|00005190| 74 68 69 73 20 73 61 6d | 70 6c 65 20 74 68 65 72 |this sam|ple ther|
|000051a0| 65 20 69 73 20 6e 6f 20 | 6f 74 68 65 72 20 70 72 |e is no |other pr|
|000051b0| 6f 63 65 73 73 69 6e 67 | 20 6e 65 63 65 73 73 61 |ocessing| necessa|
|000051c0| 72 79 20 6f 74 68 65 72 | 20 74 68 61 6e 20 77 68 |ry other| than wh|
|000051d0| 61 74 0d 2a 20 74 68 65 | 20 57 69 6e 64 6f 77 20 |at.* the| Window |
|000051e0| 4d 61 6e 61 67 65 72 20 | 68 61 73 20 61 6c 72 65 |Manager |has alre|
|000051f0| 61 64 79 20 64 6f 6e 65 | 20 66 6f 72 20 75 73 2e |ady done| for us.|
|00005200| 20 20 54 68 69 73 20 77 | 6f 75 6c 64 20 62 65 20 | This w|ould be |
|00005210| 74 68 65 20 70 6c 61 63 | 65 20 74 6f 0d 2a 20 70 |the plac|e to.* p|
|00005220| 65 72 66 6f 72 6d 20 61 | 6e 20 61 63 74 69 76 61 |erform a|n activa|
|00005230| 74 65 20 6f 6e 20 54 65 | 78 74 45 64 69 74 20 72 |te on Te|xtEdit r|
|00005240| 65 63 6f 72 64 73 2c 20 | 63 6f 6e 74 72 6f 6c 73 |ecords, |controls|
|00005250| 2c 20 6c 69 73 74 73 2c | 20 75 70 64 61 74 65 20 |, lists,| update |
|00005260| 47 72 6f 77 49 63 6f 6e | 2c 20 65 74 63 2e 0d 0d |GrowIcon|, etc...|
|00005270| 09 09 53 45 47 09 27 4d | 61 69 6e 27 09 09 09 3b |..SEG.'M|ain'...;|
|00005280| 20 63 61 73 65 20 73 65 | 6e 73 69 74 69 76 65 0d | case se|nsitive.|
|00005290| 44 6f 41 63 74 69 76 61 | 74 65 09 50 52 4f 43 0d |DoActiva|te.PROC.|
|000052a0| 0d 53 74 61 63 6b 46 72 | 61 6d 65 09 52 45 43 4f |.StackFr|ame.RECO|
|000052b0| 52 44 09 7b 41 36 4c 69 | 6e 6b 7d 2c 44 45 43 52 |RD.{A6Li|nk},DECR|
|000052c0| 09 09 3b 20 62 75 69 6c | 64 20 61 20 73 74 61 63 |..; buil|d a stac|
|000052d0| 6b 20 66 72 61 6d 65 20 | 72 65 63 6f 72 64 0d 50 |k frame |record.P|
|000052e0| 61 72 61 6d 42 65 67 69 | 6e 09 45 51 55 09 2a 09 |aramBegi|n.EQU.*.|
|000052f0| 09 09 3b 20 73 74 61 72 | 74 20 70 61 72 61 6d 65 |..; star|t parame|
|00005300| 74 65 72 73 20 61 66 74 | 65 72 20 74 68 69 73 20 |ters aft|er this |
|00005310| 70 6f 69 6e 74 0d 57 69 | 6e 64 6f 77 50 74 72 09 |point.Wi|ndowPtr.|
|00005320| 44 53 2e 4c 09 31 09 09 | 09 3b 20 70 61 73 73 65 |DS.L.1..|.; passe|
|00005330| 64 20 70 61 72 61 6d 65 | 74 65 72 20 6f 66 20 74 |d parame|ter of t|
|00005340| 68 65 20 77 69 6e 64 6f | 77 20 70 6f 69 6e 74 65 |he windo|w pointe|
|00005350| 72 0d 41 63 74 69 76 65 | 09 09 44 53 2e 57 09 31 |r.Active|..DS.W.1|
|00005360| 09 09 09 3b 20 6d 6f 64 | 69 66 69 65 72 73 20 66 |...; mod|ifiers f|
|00005370| 72 6f 6d 20 74 68 65 20 | 65 76 65 6e 74 20 72 65 |rom the |event re|
|00005380| 63 6f 72 64 0d 50 61 72 | 61 6d 53 69 7a 65 09 45 |cord.Par|amSize.E|
|00005390| 51 55 09 50 61 72 61 6d | 42 65 67 69 6e 2d 2a 09 |QU.Param|Begin-*.|
|000053a0| 09 3b 20 73 69 7a 65 20 | 6f 66 20 61 6c 6c 20 74 |.; size |of all t|
|000053b0| 68 65 20 70 61 73 73 65 | 64 20 70 61 72 61 6d 65 |he passe|d parame|
|000053c0| 74 65 72 73 0d 52 65 74 | 41 64 64 72 20 09 44 53 |ters.Ret|Addr .DS|
|000053d0| 2e 4c 09 31 09 09 09 3b | 20 70 6c 61 63 65 20 68 |.L.1...;| place h|
|000053e0| 6f 6c 64 65 72 20 66 6f | 72 20 72 65 74 75 72 6e |older fo|r return|
|000053f0| 20 61 64 64 72 65 73 73 | 0d 41 36 4c 69 6e 6b 09 | address|.A6Link.|
|00005400| 09 44 53 2e 4c 09 31 09 | 09 09 3b 20 70 6c 61 63 |.DS.L.1.|..; plac|
|00005410| 65 20 68 6f 6c 64 65 72 | 20 66 6f 72 20 41 36 20 |e holder| for A6 |
|00005420| 6c 69 6e 6b 0d 4c 6f 63 | 61 6c 53 69 7a 65 09 45 |link.Loc|alSize.E|
|00005430| 51 55 20 09 2a 09 09 09 | 3b 20 73 69 7a 65 20 6f |QU .*...|; size o|
|00005440| 66 20 61 6c 6c 20 74 68 | 65 20 6c 6f 63 61 6c 20 |f all th|e local |
|00005450| 76 61 72 69 61 62 6c 65 | 73 0d 09 09 45 4e 44 52 |variable|s...ENDR|
|00005460| 0d 09 09 0d 09 09 49 4d | 50 4f 52 54 09 49 73 41 |......IM|PORT.IsA|
|00005470| 70 70 57 69 6e 64 6f 77 | 0d 0d 09 09 57 49 54 48 |ppWindow|....WITH|
|00005480| 09 53 74 61 63 6b 46 72 | 61 6d 65 09 09 3b 20 63 |.StackFr|ame..; c|
|00005490| 6f 76 65 72 20 6f 75 72 | 20 6c 6f 63 61 6c 20 73 |over our| local s|
|000054a0| 74 61 63 6b 20 66 72 61 | 6d 65 0d 09 09 4c 49 4e |tack fra|me...LIN|
|000054b0| 4b 09 41 36 2c 23 4c 6f | 63 61 6c 53 69 7a 65 09 |K.A6,#Lo|calSize.|
|000054c0| 09 3b 20 61 6c 6c 6f 63 | 61 74 65 20 6f 75 72 20 |.; alloc|ate our |
|000054d0| 6c 6f 63 61 6c 20 73 74 | 61 63 6b 20 66 72 61 6d |local st|ack fram|
|000054e0| 65 0d 0d 09 09 43 4c 52 | 2e 57 09 2d 28 53 50 29 |e....CLR|.W.-(SP)|
|000054f0| 09 09 09 3b 20 73 70 61 | 63 65 20 66 6f 72 20 72 |...; spa|ce for r|
|00005500| 65 73 75 6c 74 20 6f 66 | 20 49 73 41 70 70 57 69 |esult of| IsAppWi|
|00005510| 6e 64 6f 77 0d 09 09 4d | 4f 56 45 2e 4c 09 57 69 |ndow...M|OVE.L.Wi|
|00005520| 6e 64 6f 77 50 74 72 28 | 41 36 29 2c 2d 28 53 50 |ndowPtr(|A6),-(SP|
|00005530| 29 09 3b 20 70 61 73 73 | 20 74 68 65 20 77 69 6e |).; pass| the win|
|00005540| 64 6f 77 20 70 6f 69 6e | 74 65 72 0d 09 09 42 53 |dow poin|ter...BS|
|00005550| 52 09 49 73 41 70 70 57 | 69 6e 64 6f 77 09 09 3b |R.IsAppW|indow..;|
|00005560| 20 74 65 73 74 20 69 66 | 20 74 68 69 73 20 77 69 | test if| this wi|
|00005570| 6e 64 6f 77 20 77 61 73 | 20 6f 75 72 73 0d 09 09 |ndow was| ours...|
|00005580| 4d 4f 56 45 2e 57 09 28 | 53 50 29 2b 2c 44 30 09 |MOVE.W.(|SP)+,D0.|
|00005590| 09 3b 20 67 65 74 20 74 | 68 65 20 72 65 73 75 6c |.; get t|he resul|
|000055a0| 74 0d 09 09 43 4d 50 49 | 2e 57 09 23 54 72 75 65 |t...CMPI|.W.#True|
|000055b0| 2c 44 30 09 09 3b 20 69 | 74 20 6d 75 73 74 20 62 |,D0..; i|t must b|
|000055c0| 65 20 6f 75 72 20 77 69 | 6e 64 6f 77 0d 09 09 42 |e our wi|ndow...B|
|000055d0| 4e 45 2e 53 09 45 78 69 | 74 09 09 09 3b 20 69 74 |NE.S.Exi|t...; it|
|000055e0| 20 77 61 73 6e 27 74 20 | 6f 75 72 20 77 69 6e 64 | wasn't |our wind|
|000055f0| 6f 77 0d 0d 09 09 43 4d | 50 49 2e 57 09 23 54 72 |ow....CM|PI.W.#Tr|
|00005600| 75 65 2c 41 63 74 69 76 | 65 28 41 36 29 09 3b 20 |ue,Activ|e(A6).; |
|00005610| 77 61 73 20 69 74 20 61 | 6e 20 41 63 74 69 76 61 |was it a|n Activa|
|00005620| 74 65 3f 0d 09 09 42 4e | 45 2e 53 09 44 65 41 63 |te?...BN|E.S.DeAc|
|00005630| 74 69 76 61 74 65 09 09 | 3b 20 6e 6f 2c 20 70 65 |tivate..|; no, pe|
|00005640| 72 66 6f 72 6d 20 61 20 | 44 65 61 63 74 69 76 61 |rform a |Deactiva|
|00005650| 74 65 0d 09 09 0d 2a 20 | 64 6f 20 74 68 65 20 61 |te....* |do the a|
|00005660| 63 74 69 76 61 74 65 20 | 65 76 65 6e 74 20 70 72 |ctivate |event pr|
|00005670| 6f 63 65 73 73 69 6e 67 | 20 68 65 72 65 2c 20 74 |ocessing| here, t|
|00005680| 68 65 6e 20 22 42 52 41 | 2e 53 20 20 20 45 78 69 |hen "BRA|.S Exi|
|00005690| 74 22 0d 09 09 0d 44 65 | 41 63 74 69 76 61 74 65 |t"....De|Activate|
|000056a0| 09 09 09 09 09 3b 20 64 | 6f 20 74 68 65 20 64 65 |.....; d|o the de|
|000056b0| 61 63 74 69 76 61 74 65 | 20 65 76 65 6e 74 0d 0d |activate| event..|
|000056c0| 2a 20 64 6f 20 74 68 65 | 20 64 65 61 63 74 69 76 |* do the| deactiv|
|000056d0| 61 74 65 20 65 76 65 6e | 74 20 70 72 6f 63 65 73 |ate even|t proces|
|000056e0| 73 69 6e 67 20 68 65 72 | 65 2c 20 74 68 65 6e 20 |sing her|e, then |
|000056f0| 66 61 6c 6c 20 74 68 72 | 6f 75 67 68 20 74 6f 20 |fall thr|ough to |
|00005700| 45 78 69 74 0d 09 09 0d | 0d 45 78 69 74 09 09 55 |Exit....|.Exit..U|
|00005710| 4e 4c 4b 09 41 36 09 09 | 09 3b 20 64 65 73 74 72 |NLK.A6..|.; destr|
|00005720| 6f 79 20 74 68 65 20 6c | 69 6e 6b 0d 09 09 4d 4f |oy the l|ink...MO|
|00005730| 56 45 41 2e 4c 09 28 53 | 50 29 2b 2c 41 30 09 09 |VEA.L.(S|P)+,A0..|
|00005740| 3b 20 70 75 6c 6c 20 6f | 66 66 20 74 68 65 20 72 |; pull o|ff the r|
|00005750| 65 74 75 72 6e 20 61 64 | 64 72 65 73 73 0d 09 09 |eturn ad|dress...|
|00005760| 41 44 44 41 2e 4c 09 23 | 50 61 72 61 6d 53 69 7a |ADDA.L.#|ParamSiz|
|00005770| 65 2c 53 50 09 09 3b 20 | 73 74 72 69 70 20 61 6c |e,SP..; |strip al|
|00005780| 6c 20 6f 66 20 74 68 65 | 20 63 61 6c 6c 65 72 27 |l of the| caller'|
|00005790| 73 20 70 61 72 61 6d 65 | 74 65 72 73 0d 09 09 4a |s parame|ters...J|
|000057a0| 4d 50 09 28 41 30 29 09 | 09 09 3b 20 72 65 74 75 |MP.(A0).|..; retu|
|000057b0| 72 6e 20 74 6f 20 74 68 | 65 20 63 61 6c 6c 65 72 |rn to th|e caller|
|000057c0| 0d 0d 09 09 44 62 67 49 | 6e 66 6f 09 41 63 74 69 |....DbgI|nfo.Acti|
|000057d0| 76 61 74 65 09 09 3b 20 | 74 68 69 73 20 6e 61 6d |vate..; |this nam|
|000057e0| 65 20 77 69 6c 6c 20 61 | 70 70 65 61 72 20 69 6e |e will a|ppear in|
|000057f0| 20 74 68 65 20 64 65 62 | 75 67 67 65 72 0d 09 09 | the deb|ugger...|
|00005800| 45 4e 44 50 0d 09 09 09 | 09 09 0d 2a 20 3d 3d 3d |ENDP....|...* ===|
|00005810| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00005820| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00005830| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 0d 2a 20 |========|=====.* |
|00005840| 50 52 4f 43 45 44 55 52 | 45 20 44 6f 4d 65 6e 75 |PROCEDUR|E DoMenu|
|00005850| 43 6f 6d 6d 61 6e 64 28 | 6d 65 6e 75 52 65 73 75 |Command(|menuResu|
|00005860| 6c 74 3a 20 4c 4f 4e 47 | 49 4e 54 29 3b 0d 2a 20 |lt: LONG|INT);.* |
|00005870| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00005880| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00005890| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000058a0| 0d 2a 20 54 68 69 73 20 | 69 73 20 63 61 6c 6c 65 |.* This |is calle|
|000058b0| 64 20 77 68 65 6e 20 61 | 6e 20 69 74 65 6d 20 69 |d when a|n item i|
|000058c0| 73 20 63 68 6f 73 65 6e | 20 66 72 6f 6d 20 74 68 |s chosen| from th|
|000058d0| 65 20 6d 65 6e 75 20 62 | 61 72 20 28 61 66 74 65 |e menu b|ar (afte|
|000058e0| 72 20 63 61 6c 6c 69 6e | 67 0d 2a 20 4d 65 6e 75 |r callin|g.* Menu|
|000058f0| 53 65 6c 65 63 74 20 6f | 72 20 4d 65 6e 75 4b 65 |Select o|r MenuKe|
|00005900| 79 29 2e 20 49 74 20 70 | 65 72 66 6f 72 6d 73 20 |y). It p|erforms |
|00005910| 74 68 65 20 72 69 67 68 | 74 20 6f 70 65 72 61 74 |the righ|t operat|
|00005920| 69 6f 6e 20 66 6f 72 20 | 65 61 63 68 20 63 6f 6d |ion for |each com|
|00005930| 6d 61 6e 64 2e 0d 2a 20 | 49 74 20 69 73 20 67 6f |mand..* |It is go|
|00005940| 6f 64 20 74 6f 20 68 61 | 76 65 20 62 6f 74 68 20 |od to ha|ve both |
|00005950| 74 68 65 20 72 65 73 75 | 6c 74 20 6f 66 20 4d 65 |the resu|lt of Me|
|00005960| 6e 75 53 65 6c 65 63 74 | 20 61 6e 64 20 4d 65 6e |nuSelect| and Men|
|00005970| 75 4b 65 79 20 67 6f 20 | 74 6f 0d 2a 20 6f 6e 65 |uKey go |to.* one|
|00005980| 20 72 6f 75 74 69 6e 65 | 20 6c 69 6b 65 20 74 68 | routine| like th|
|00005990| 69 73 20 74 6f 20 6b 65 | 65 70 20 65 76 65 72 79 |is to ke|ep every|
|000059a0| 74 68 69 6e 67 20 6f 72 | 67 61 6e 69 7a 65 64 2e |thing or|ganized.|
|000059b0| 0d 0d 09 09 53 45 47 09 | 27 4d 61 69 6e 27 09 09 |....SEG.|'Main'..|
|000059c0| 09 3b 20 63 61 73 65 20 | 73 65 6e 73 69 74 69 76 |.; case |sensitiv|
|000059d0| 65 0d 44 6f 4d 65 6e 75 | 43 6f 6d 6d 61 6e 64 09 |e.DoMenu|Command.|
|000059e0| 50 52 4f 43 0d 0d 53 74 | 61 63 6b 46 72 61 6d 65 |PROC..St|ackFrame|
|000059f0| 09 52 45 43 4f 52 44 09 | 7b 41 36 4c 69 6e 6b 7d |.RECORD.|{A6Link}|
|00005a00| 2c 44 45 43 52 09 09 3b | 20 62 75 69 6c 64 20 61 |,DECR..;| build a|
|00005a10| 20 73 74 61 63 6b 20 66 | 72 61 6d 65 20 72 65 63 | stack f|rame rec|
|00005a20| 6f 72 64 0d 50 61 72 61 | 6d 42 65 67 69 6e 09 45 |ord.Para|mBegin.E|
|00005a30| 51 55 09 2a 09 09 09 3b | 20 73 74 61 72 74 20 70 |QU.*...;| start p|
|00005a40| 61 72 61 6d 65 74 65 72 | 73 20 61 66 74 65 72 20 |arameter|s after |
|00005a50| 74 68 69 73 20 70 6f 69 | 6e 74 0d 4d 65 6e 75 49 |this poi|nt.MenuI|
|00005a60| 74 65 6d 09 44 53 2e 57 | 09 31 09 09 09 3b 20 72 |tem.DS.W|.1...; r|
|00005a70| 65 73 75 6c 74 20 66 72 | 6f 6d 20 5f 4d 65 6e 75 |esult fr|om _Menu|
|00005a80| 4b 65 79 20 6f 72 20 5f | 4d 65 6e 75 53 65 6c 65 |Key or _|MenuSele|
|00005a90| 63 74 0d 4d 65 6e 75 49 | 44 09 09 44 53 2e 57 09 |ct.MenuI|D..DS.W.|
|00005aa0| 31 09 09 09 3b 20 63 61 | 6c 6c 65 72 20 70 61 73 |1...; ca|ller pas|
|00005ab0| 73 65 64 20 61 20 6c 6f | 6e 67 20 77 6f 72 64 2c |sed a lo|ng word,|
|00005ac0| 20 49 44 20 2b 20 49 74 | 65 6d 0d 50 61 72 61 6d | ID + It|em.Param|
|00005ad0| 53 69 7a 65 09 45 51 55 | 09 50 61 72 61 6d 42 65 |Size.EQU|.ParamBe|
|00005ae0| 67 69 6e 2d 2a 09 09 3b | 20 73 69 7a 65 20 6f 66 |gin-*..;| size of|
|00005af0| 20 61 6c 6c 20 74 68 65 | 20 70 61 73 73 65 64 20 | all the| passed |
|00005b00| 70 61 72 61 6d 65 74 65 | 72 73 0d 52 65 74 41 64 |paramete|rs.RetAd|
|00005b10| 64 72 20 09 44 53 2e 4c | 09 31 09 09 09 3b 20 70 |dr .DS.L|.1...; p|
|00005b20| 6c 61 63 65 20 68 6f 6c | 64 65 72 20 66 6f 72 20 |lace hol|der for |
|00005b30| 72 65 74 75 72 6e 20 61 | 64 64 72 65 73 73 0d 41 |return a|ddress.A|
|00005b40| 36 4c 69 6e 6b 09 09 44 | 53 2e 4c 09 31 09 09 09 |6Link..D|S.L.1...|
|00005b50| 3b 20 70 6c 61 63 65 20 | 68 6f 6c 64 65 72 20 66 |; place |holder f|
|00005b60| 6f 72 20 41 36 20 6c 69 | 6e 6b 0d 44 65 73 6b 6e |or A6 li|nk.Deskn|
|00005b70| 61 6d 65 09 44 53 2e 42 | 09 32 35 36 09 09 09 3b |ame.DS.B|.256...;|
|00005b80| 20 6c 6f 63 61 6c 20 73 | 74 6f 72 61 67 65 20 66 | local s|torage f|
|00005b90| 6f 72 20 44 65 73 6b 20 | 41 63 63 73 20 6e 61 6d |or Desk |Accs nam|
|00005ba0| 65 0d 54 65 6d 70 50 6f | 72 74 09 44 53 2e 4c 09 |e.TempPo|rt.DS.L.|
|00005bb0| 31 09 09 09 3b 20 6c 6f | 63 61 6c 20 73 74 6f 72 |1...; lo|cal stor|
|00005bc0| 61 67 65 20 66 6f 72 20 | 74 68 65 20 63 75 72 72 |age for |the curr|
|00005bd0| 65 6e 74 20 70 6f 72 74 | 0d 4c 6f 63 61 6c 53 69 |ent port|.LocalSi|
|00005be0| 7a 65 09 45 51 55 20 09 | 2a 09 09 09 3b 20 73 69 |ze.EQU .|*...; si|
|00005bf0| 7a 65 20 6f 66 20 61 6c | 6c 20 74 68 65 20 6c 6f |ze of al|l the lo|
|00005c00| 63 61 6c 20 76 61 72 69 | 61 62 6c 65 73 0d 09 09 |cal vari|ables...|
|00005c10| 45 4e 44 52 0d 09 09 0d | 09 09 49 4d 50 4f 52 54 |ENDR....|..IMPORT|
|00005c20| 09 53 65 74 4c 69 67 68 | 74 2c 44 6f 43 6c 6f 73 |.SetLigh|t,DoClos|
|00005c30| 65 57 69 6e 64 6f 77 2c | 54 65 72 6d 69 6e 61 74 |eWindow,|Terminat|
|00005c40| 65 0d 0d 09 09 57 49 54 | 48 09 53 74 61 63 6b 46 |e....WIT|H.StackF|
|00005c50| 72 61 6d 65 09 09 3b 20 | 63 6f 76 65 72 20 6f 75 |rame..; |cover ou|
|00005c60| 72 20 6c 6f 63 61 6c 20 | 73 74 61 63 6b 20 66 72 |r local |stack fr|
|00005c70| 61 6d 65 0d 09 09 4c 49 | 4e 4b 09 41 36 2c 23 4c |ame...LI|NK.A6,#L|
|00005c80| 6f 63 61 6c 53 69 7a 65 | 09 09 3b 20 61 6c 6c 6f |ocalSize|..; allo|
|00005c90| 63 61 74 65 20 6f 75 72 | 20 6c 6f 63 61 6c 20 73 |cate our| local s|
|00005ca0| 74 61 63 6b 20 66 72 61 | 6d 65 0d 0d 09 09 4d 4f |tack fra|me....MO|
|00005cb0| 56 45 2e 57 09 4d 65 6e | 75 49 44 28 41 36 29 2c |VE.W.Men|uID(A6),|
|00005cc0| 44 30 09 09 3b 20 61 20 | 6e 69 66 74 79 20 50 61 |D0..; a |nifty Pa|
|00005cd0| 73 63 61 6c 20 63 61 73 | 65 2d 6c 69 6b 65 20 6d |scal cas|e-like m|
|00005ce0| 61 63 72 6f 0d 09 09 43 | 41 53 45 23 2e 57 09 28 |acro...C|ASE#.W.(|
|00005cf0| 44 30 2c 49 46 29 2c 09 | 09 09 5c 0d 09 09 09 28 |D0,IF),.|..\....(|
|00005d00| 41 70 70 6c 65 4d 65 6e | 75 2c 09 44 6f 41 70 70 |AppleMen|u,.DoApp|
|00005d10| 6c 65 4d 65 6e 75 29 2c | 09 5c 0d 09 09 09 28 46 |leMenu),|.\....(F|
|00005d20| 69 6c 65 4d 65 6e 75 2c | 09 44 6f 46 69 6c 65 4d |ileMenu,|.DoFileM|
|00005d30| 65 6e 75 29 2c 09 5c 0d | 09 09 09 28 45 64 69 74 |enu),.\.|...(Edit|
|00005d40| 4d 65 6e 75 2c 09 44 6f | 45 64 69 74 4d 65 6e 75 |Menu,.Do|EditMenu|
|00005d50| 29 2c 09 5c 0d 09 09 09 | 28 4c 69 67 68 74 4d 65 |),.\....|(LightMe|
|00005d60| 6e 75 2c 09 44 6f 4c 69 | 67 68 74 4d 65 6e 75 29 |nu,.DoLi|ghtMenu)|
|00005d70| 0d 09 09 09 09 09 09 3b | 20 61 64 64 20 61 64 64 |.......;| add add|
|00005d80| 69 74 69 6f 6e 61 6c 20 | 4d 65 6e 75 73 20 77 6f |itional |Menus wo|
|00005d90| 75 6c 64 20 67 6f 20 68 | 65 72 65 0d 09 09 42 52 |uld go h|ere...BR|
|00005da0| 41 2e 57 09 45 78 69 74 | 09 09 09 3b 20 6f 74 68 |A.W.Exit|...; oth|
|00005db0| 65 72 77 69 73 65 20 77 | 65 20 77 69 6c 6c 20 65 |erwise w|e will e|
|00005dc0| 78 69 74 20 74 68 69 73 | 20 70 72 6f 63 65 64 75 |xit this| procedu|
|00005dd0| 72 65 0d 0d 2a 20 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |re..* --|--------|
|00005de0| 2d 2d 2d 20 54 48 45 20 | 41 50 50 4c 45 20 4d 45 |--- THE |APPLE ME|
|00005df0| 4e 55 20 52 4f 55 54 49 | 4e 45 53 20 2d 2d 2d 2d |NU ROUTI|NES ----|
|00005e00| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 0d 44 6f 41 70 70 6c |--------|-.DoAppl|
|00005e10| 65 4d 65 6e 75 0d 09 09 | 43 4d 50 49 2e 57 09 23 |eMenu...|CMPI.W.#|
|00005e20| 41 62 6f 75 74 49 74 65 | 6d 2c 4d 65 6e 75 49 74 |AboutIte|m,MenuIt|
|00005e30| 65 6d 28 41 36 29 09 3b | 20 77 61 73 20 69 74 20 |em(A6).;| was it |
|00005e40| 74 68 65 20 61 62 6f 75 | 74 20 69 74 65 6d 3f 0d |the abou|t item?.|
|00005e50| 09 09 42 4e 45 2e 53 09 | 40 31 09 09 09 3b 20 6e |..BNE.S.|@1...; n|
|00005e60| 6f 2c 20 6d 75 73 74 20 | 62 65 20 61 20 44 65 73 |o, must |be a Des|
|00005e70| 6b 20 41 63 63 0d 0d 09 | 09 43 4c 52 2e 57 09 2d |k Acc...|.CLR.W.-|
|00005e80| 28 53 50 29 09 09 09 3b | 20 73 68 6f 77 20 74 68 |(SP)...;| show th|
|00005e90| 65 20 41 62 6f 75 74 20 | 64 69 61 6c 6f 67 0d 09 |e About |dialog..|
|00005ea0| 09 4d 4f 56 45 2e 57 09 | 23 72 41 62 6f 75 74 41 |.MOVE.W.|#rAboutA|
|00005eb0| 6c 65 72 74 2c 2d 28 53 | 50 29 09 3b 20 72 65 73 |lert,-(S|P).; res|
|00005ec0| 6f 75 72 63 65 20 66 6f | 72 20 61 6c 65 72 74 20 |ource fo|r alert |
|00005ed0| 64 69 61 6c 6f 67 0d 09 | 09 43 4c 52 2e 4c 09 2d |dialog..|.CLR.L.-|
|00005ee0| 28 53 50 29 09 09 09 3b | 20 6e 6f 20 66 69 6c 74 |(SP)...;| no filt|
|00005ef0| 65 72 20 70 72 6f 63 65 | 64 75 72 65 20 75 73 65 |er proce|dure use|
|00005f00| 64 20 68 65 72 65 0d 09 | 09 5f 41 6c 65 72 74 09 |d here..|._Alert.|
|00005f10| 09 09 09 3b 20 72 65 61 | 64 20 74 68 65 20 72 65 |...; rea|d the re|
|00005f20| 73 6f 75 72 63 65 20 61 | 6e 64 20 64 69 73 70 6c |source a|nd displ|
|00005f30| 61 79 20 69 74 0d 09 09 | 4d 4f 56 45 2e 57 09 28 |ay it...|MOVE.W.(|
|00005f40| 53 50 29 2b 2c 44 30 09 | 09 3b 20 49 20 64 6f 6e |SP)+,D0.|.; I don|
|00005f50| 27 74 20 63 61 72 65 20 | 77 68 69 63 68 20 69 74 |'t care |which it|
|00005f60| 65 6d 20 69 73 20 77 61 | 73 0d 09 09 42 52 41 2e |em is wa|s...BRA.|
|00005f70| 57 09 45 78 69 74 09 09 | 09 3b 20 61 6c 6c 20 64 |W.Exit..|.; all d|
|00005f80| 6f 6e 65 20 77 69 74 68 | 20 77 69 74 68 20 41 70 |one with| with Ap|
|00005f90| 70 6c 65 20 6d 65 6e 75 | 0d 0d 40 31 09 09 50 45 |ple menu|..@1..PE|
|00005fa0| 41 09 54 65 6d 70 50 6f | 72 74 28 41 36 29 09 09 |A.TempPo|rt(A6)..|
|00005fb0| 3b 20 6f 70 65 6e 20 61 | 20 64 65 73 6b 20 61 63 |; open a| desk ac|
|00005fc0| 63 65 73 73 6f 72 79 0d | 09 09 5f 47 65 74 50 6f |cessory.|.._GetPo|
|00005fd0| 72 74 09 09 09 3b 20 73 | 61 76 65 20 74 68 65 20 |rt...; s|ave the |
|00005fe0| 63 75 72 72 65 6e 74 20 | 70 6f 72 74 0d 09 09 43 |current |port...C|
|00005ff0| 4c 52 2e 4c 09 2d 28 53 | 50 29 09 09 09 3b 20 73 |LR.L.-(S|P)...; s|
|00006000| 70 61 63 65 20 66 6f 72 | 20 72 65 73 75 6c 74 20 |pace for| result |
|00006010| 6f 66 20 47 65 74 4d 48 | 61 6e 64 6c 65 0d 09 09 |of GetMH|andle...|
|00006020| 4d 4f 56 45 2e 57 09 23 | 41 70 70 6c 65 4d 65 6e |MOVE.W.#|AppleMen|
|00006030| 75 2c 2d 28 53 50 29 0d | 09 09 5f 47 65 74 4d 48 |u,-(SP).|.._GetMH|
|00006040| 61 6e 64 6c 65 09 09 09 | 3b 20 70 75 74 20 41 70 |andle...|; put Ap|
|00006050| 70 6c 65 20 6d 65 6e 75 | 20 6f 6e 20 73 74 61 63 |ple menu| on stac|
|00006060| 6b 0d 09 09 4d 4f 56 45 | 2e 57 09 4d 65 6e 75 49 |k...MOVE|.W.MenuI|
|00006070| 74 65 6d 28 41 36 29 2c | 2d 28 53 50 29 09 3b 20 |tem(A6),|-(SP).; |
|00006080| 61 6e 64 20 68 65 72 65 | 27 73 20 74 68 65 20 4d |and here|'s the M|
|00006090| 65 6e 75 49 74 65 6d 0d | 09 09 50 45 41 09 44 65 |enuItem.|..PEA.De|
|000060a0| 73 6b 4e 61 6d 65 28 41 | 36 29 09 09 3b 20 6e 6f |skName(A|6)..; no|
|000060b0| 77 20 74 65 6c 6c 20 6d | 65 20 74 68 65 20 44 41 |w tell m|e the DA|
|000060c0| 27 73 20 6e 61 6d 65 0d | 09 09 5f 47 65 74 49 74 |'s name.|.._GetIt|
|000060d0| 65 6d 0d 09 09 43 4c 52 | 2e 57 09 2d 28 53 50 29 |em...CLR|.W.-(SP)|
|000060e0| 09 09 09 3b 20 73 70 61 | 63 65 20 66 6f 72 20 4f |...; spa|ce for O|
|000060f0| 70 65 6e 44 65 73 6b 41 | 63 63 20 72 65 73 75 6c |penDeskA|cc resul|
|00006100| 74 0d 09 09 50 45 41 09 | 44 65 73 6b 4e 61 6d 65 |t...PEA.|DeskName|
|00006110| 28 41 36 29 0d 09 09 5f | 4f 70 65 6e 44 65 73 6b |(A6)..._|OpenDesk|
|00006120| 41 63 63 09 09 09 3b 20 | 6f 70 65 6e 20 74 68 61 |Acc...; |open tha|
|00006130| 74 20 70 75 70 70 79 0d | 09 09 4d 4f 56 45 2e 57 |t puppy.|..MOVE.W|
|00006140| 09 28 53 50 29 2b 2c 44 | 30 09 09 3b 20 72 65 73 |.(SP)+,D|0..; res|
|00006150| 75 6c 74 0d 09 09 4d 4f | 56 45 2e 4c 09 54 65 6d |ult...MO|VE.L.Tem|
|00006160| 70 50 6f 72 74 28 41 36 | 29 2c 2d 28 53 50 29 09 |pPort(A6|),-(SP).|
|00006170| 3b 20 72 65 73 74 6f 72 | 65 20 74 68 65 20 70 6f |; restor|e the po|
|00006180| 72 74 0d 09 09 5f 53 65 | 74 50 6f 72 74 0d 09 09 |rt..._Se|tPort...|
|00006190| 42 52 41 2e 53 09 45 78 | 69 74 0d 09 09 0d 2a 20 |BRA.S.Ex|it....* |
|000061a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 20 54 48 |--------|----- TH|
|000061b0| 45 20 46 49 4c 45 20 4d | 45 4e 55 20 52 4f 55 54 |E FILE M|ENU ROUT|
|000061c0| 49 4e 45 53 20 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |INES ---|--------|
|000061d0| 2d 2d 0d 44 6f 46 69 6c | 65 4d 65 6e 75 09 0d 09 |--.DoFil|eMenu...|
|000061e0| 09 4d 4f 56 45 2e 57 09 | 4d 65 6e 75 49 74 65 6d |.MOVE.W.|MenuItem|
|000061f0| 28 41 36 29 2c 44 30 20 | 09 3b 20 74 65 73 74 20 |(A6),D0 |.; test |
|00006200| 74 68 65 20 4d 65 6e 75 | 49 74 65 6d 0d 09 09 43 |the Menu|Item...C|
|00006210| 61 73 65 23 2e 57 09 28 | 44 30 2c 49 46 29 2c 09 |ase#.W.(|D0,IF),.|
|00006220| 09 09 5c 0d 09 09 09 28 | 43 6c 6f 73 65 49 74 65 |..\....(|CloseIte|
|00006230| 6d 2c 09 46 69 6c 65 43 | 6c 6f 73 65 29 2c 09 5c |m,.FileC|lose),.\|
|00006240| 0d 09 09 09 28 51 75 69 | 74 49 74 65 6d 2c 09 46 |....(Qui|tItem,.F|
|00006250| 69 6c 65 51 75 69 74 29 | 0d 09 09 42 52 41 2e 53 |ileQuit)|...BRA.S|
|00006260| 09 45 78 69 74 09 09 09 | 3b 20 61 64 64 20 61 64 |.Exit...|; add ad|
|00006270| 64 69 74 69 6f 6e 61 6c | 20 6d 65 6e 75 73 20 68 |ditional| menus h|
|00006280| 65 72 65 0d 46 69 6c 65 | 43 6c 6f 73 65 0d 09 09 |ere.File|Close...|
|00006290| 5f 46 72 6f 6e 74 57 69 | 6e 64 6f 77 0d 09 09 42 |_FrontWi|ndow...B|
|000062a0| 53 52 09 44 6f 43 6c 6f | 73 65 57 69 6e 64 6f 77 |SR.DoClo|seWindow|
|000062b0| 09 09 3b 20 63 6c 6f 73 | 65 20 74 68 65 20 77 69 |..; clos|e the wi|
|000062c0| 6e 64 6f 77 20 0d 09 09 | 42 52 41 2e 53 09 45 78 |ndow ...|BRA.S.Ex|
|000062d0| 69 74 0d 0d 46 69 6c 65 | 51 75 69 74 09 42 53 52 |it..File|Quit.BSR|
|000062e0| 09 54 65 72 6d 69 6e 61 | 74 65 09 09 3b 20 6c 65 |.Termina|te..; le|
|000062f0| 74 27 73 20 67 65 74 20 | 6f 75 74 20 6f 66 20 68 |t's get |out of h|
|00006300| 65 72 65 0d 09 09 42 52 | 41 2e 53 09 45 78 69 74 |ere...BR|A.S.Exit|
|00006310| 09 09 09 3b 20 54 65 72 | 6d 69 6e 61 74 65 20 6d |...; Ter|minate m|
|00006320| 61 79 20 72 65 74 75 72 | 6e 20 69 66 20 75 73 65 |ay retur|n if use|
|00006330| 72 20 63 61 6e 63 65 6c | 73 0d 0d 2a 20 2d 2d 2d |r cancel|s..* ---|
|00006340| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 20 54 48 45 20 45 |--------|-- THE E|
|00006350| 44 49 54 20 4d 45 4e 55 | 20 52 4f 55 54 49 4e 45 |DIT MENU| ROUTINE|
|00006360| 53 20 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0d |S ------|-------.|
|00006370| 44 6f 45 64 69 74 4d 65 | 6e 75 09 0d 09 09 43 4c |DoEditMe|nu....CL|
|00006380| 52 2e 57 09 2d 28 53 50 | 29 09 09 09 3b 20 73 79 |R.W.-(SP|)...; sy|
|00006390| 73 74 65 6d 20 77 69 6c | 6c 20 68 61 6e 64 6c 65 |stem wil|l handle|
|000063a0| 20 65 64 69 74 69 6e 67 | 20 6f 66 20 64 65 73 6b | editing| of desk|
|000063b0| 20 61 63 63 73 2e 0d 09 | 09 4d 4f 56 45 2e 57 09 | accs...|.MOVE.W.|
|000063c0| 4d 65 6e 75 49 74 65 6d | 28 41 36 29 2c 2d 28 53 |MenuItem|(A6),-(S|
|000063d0| 50 29 09 3b 20 67 65 74 | 20 74 68 65 20 4d 65 6e |P).; get| the Men|
|000063e0| 75 49 74 65 6d 0d 09 09 | 53 55 42 51 2e 57 09 23 |uItem...|SUBQ.W.#|
|000063f0| 31 2c 28 53 50 29 09 09 | 09 3b 20 53 79 73 74 65 |1,(SP)..|.; Syste|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.